-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
[Bug]: shfmt doesn't respect editorconfig-defined ignored files #80
Comments
Ah, sorry, I forgot to finish my thought. This might just be a feature request for a rules_lint ignore list / function to prevent these files from being passed to (at least) the |
Thanks for pointing to the black --force-exclude as a precedent on that issue. I agree that's the desirable fix here. I think you could also make the case that pre-commit hooks will fall into the same trap - pre-commit.com is pretty popular FWICT, does it have this bug too? |
What happened?
I have a file in my vendor'd
third_party
directory. There's a shell script in that directory that's not correctly formatted. Normally, I'd be able to instruct theshfmt
tool to ignore that directory by setting up an.editorconfig
file that looks like this:This is described in the
shfmt
documentation.Unfortunately, the
shfmt
tool only applies thisignore
setting when it's being passed a directory to walk. When passed a list of filenames directly,shfmt
formats the files with no regard to theignore
setting. This is an open issue on theshfmt
's bug tracker, but the author feels that the tool's behavior is correct.Version
Development (host) and target OS/architectures:
Linux / amd64
Output of
bazel --version
:6.2.1
Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file:v0.7.0
Language(s) and/or frameworks involved:
shfmt
How to reproduce
third_party/bad.sh
:shfmt
to ignore it by adding an.editorconfig
file://:format
targetExpected results:
third_party/bad.sh
isn't changedActual results:
third_party/bad.sh
is reformattedAny other information?
No response
The text was updated successfully, but these errors were encountered: