-
Notifications
You must be signed in to change notification settings - Fork 73
Ignore certain file types / directories in style_file()
#656
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
Comments
I don't think this is a styler problem, although #319 might be a related issue. If it's only about using pre-commit, use the |
Will setting a file type in I tried excluding all YAML files by adding Feel free to move the issue to {precommit} :) |
No you have to set the # ...
- id: style-files
exclude: >
(?x)^(
.*\.yaml
)$ |
Thanks. Still gets styled. And yes, it is Does it matter that the files lives in |
I don't get why you want to exclude them from the hook, they are not going to be changed anyways. What do you mean with gets styled? Not skipped from the pre-commit output during |
The styler hook also styles |
Are you sure it's the styler hook? styler can only style R files and friends (Rnw, Rmd, Rpfofile etc). I have the stong apprehension that it is in fact a hook like https://github.com/lorenzwalthert/precommit/blob/master/.pre-commit-config.yaml#L45 or similar. Can you show the output of |
Ahh! I did not see this hook before. Just tested it and indeed it is the Sorry for the trouble! |
Yeah, me too haha. Good to have some context sometimes, then tricky problems become simple 😊. |
I would like {styler} to either
.yml
files).inst/
).I know this exists in
style_pkg(exclude_dirs = )
. However, when invoking {styler} via {precommit},style_file()
is called which does not have this option.This might be a bit tricky since
style_file
is explicitly called on a path by {precommit} and hence some preprocessing before calling it might need to happen?The text was updated successfully, but these errors were encountered: