-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow passing a file path when using --stdin #1123
Comments
This additional reason is not true. When the editorconfig parameter is specified it overrides any
Given above, it does not seem to have an added value to specify the file path explicitly. |
A problem that was not mentioned before is that by not having the file path available some rules like Providing the file location could fix this behavior. |
…ation for stdin
…ation for stdin
Fixes #1123 --------- Co-authored-by: Alex Decker <[email protected]> Co-authored-by: Paul Dingemans <[email protected]>
When formatting using --stdin, you lose filename/path in any error messages (obviously). Additionally there's no way to use things like specific-directory editorconfig overrides, which depend on knowing the file location.
This affects some tools like git-format-staged, which work by passing files through stdin. To get around this, some other formatters allow passing a path to treat as the current file path e.g. --stdin-filepath in Prettier, or --stdinpath in SwiftFormat.
It'd be great if ktlint supported this too!
The text was updated successfully, but these errors were encountered: