-
Notifications
You must be signed in to change notification settings - Fork 73
Support exclusion comments #542
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
This is a duplicate of #365 and #533. As noted in these issues, we are working on detecting alignment to fix the most common case where styler falls short of the expectations. It's already done for function calls in the devel version of styler, the heuristic are outlined in the corresponding vignette. |
This should be reopened. We are coming close to a point where calling styler can happen by default as a precommit across all of our packages. But, we are facing some problems with some jobs that parse R files, as they weren't written with styler's formatting conventions in mind. Being able to turn styler off for these edge cases, and even better for just part of the code, would be really helpful. |
As pointed out, I don’t see a lot of value in that. I‘d prefer to focus on concrete cases and try to improve formatting there. If you have any, please open a new issue. The formatter should be so good that there is no need for exceptions. Also, implementing this feature is non-trivial and likely to slow down styler and make it more complex - for limited gain. Instead of marking many lines with I might think about how to implement this a bit - if you have concrete suggestions, please let me know. |
No let's open the original issue. |
We have a draft :-). Feedback welcome, please in the PR (#560), not here in the issue. remotes::install_github("lorenzwalthert/styler@stylerignore") |
Closed with #560. |
This was mentioned in separate issues, but would be useful to track separately.
There are many cases where it might be useful to disable styler for either a line or across multiple lines. This is supported in jimhester/lintr with
This is similar to functionality in google/yapf:
https://github.com/google/yapf#why-does-yapf-destroy-my-awesome-formatting
The text was updated successfully, but these errors were encountered: