-
Notifications
You must be signed in to change notification settings - Fork 70
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
Also recognize lintr ignore markers #849
Conversation
Codecov Report
@@ Coverage Diff @@
## main #849 +/- ##
==========================================
- Coverage 90.04% 90.04% -0.01%
==========================================
Files 47 47
Lines 2480 2490 +10
==========================================
+ Hits 2233 2242 +9
- Misses 247 248 +1
Continue to review full report at Codecov.
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 27b8ab9 is merged into master:
Further explanation regarding interpretation and methodology can be found in the documentation. |
I'm not sure about turning it on by default, though the extension to recognize multiple is good for allowing them to be set in sync if so desired. indeed I just wrote some code this week like
which would look cleaner if there's a single symbol. |
stylerignore markers must be alone on a line, so you code won't work. styler::style_text('
# nolint start styler: off
call+1
# nolint end styler: on
')
#>
#> # nolint start styler: off
#> call + 1
#> # nolint end styler: on Created on 2021-10-09 by the reprex package (v2.0.1) Yet another alternative would be to make this work too by matching the regex
? I honestly think the number of cases when you want styler but not lintr or vice versa is very limited, so I think people should opt out in that case. |
Probably the most common
And many similar cases where we want to use whitespace to make the code cleaner to read. In those cases I still want (most) lints to apply... so I'm not sure what the default should be. Is there any empirical check we can do? How reliable do we think CRAN revdeps are for giving us insight here? Definitely think a regex match is good... or as another suggestion, an exact match of |
Then probably we should extend alignment detection :D
I don't think that will help, as I don't think a lot of packages have explicit {styler} tests.
I would only match text within a |
I just opted for regex matching of a single marker, keeping the default as is. Please see |
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 8f18af8 is merged into main:
Further explanation regarding interpretation and methodology can be found in the documentation. |
@MichaelChirico any final thoughts? |
@MichaelChirico what do you think about this? From NEWS.md:
Closes #848