-
Notifications
You must be signed in to change notification settings - Fork 186
linter exclusions bug #746
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
Note further, if the call to lint_package is made with a named list (and with the lint-exclusion comments as they initially were, with the closing dot), no object-name lints are thrown:
(but now, if I remove the terminal dot in the exclusion comment, the object-name lints are thrown) |
The expected behaviour here is:
|
At first glance this looks like a regression introduced by the Re expected behaviour: I'd expect |
Here's the problem:
We need to change the implementation of |
@russHyde WDYT about the defaults being the match of This would auto name The changed separator is necessary if we stick with the current specification for linter exclusions as it does not allow dots in the names. What I don't like about |
I think we have an even bigger problem. With the custom linters going in, |
Do you think anyone would be using multiple copies of the same I'm afraid I didn't follow the bit about deparse'ing a custom linter. Making the Linter class smarter about naming would clarify the code a bit. For example, there's duplication of the linter-name in a few places in the code-base and it can be a bit confusing
|
I've started a draft to make this smarter.
Could work nicely with global.R
|
* add name attribute to Linter class fixes #746 * fix test failures * document() * restore 100% coverage for utils.R * deprecate Lint(linter = ...) and remove all calling instances make expect_lint() resilient to complete removal of the argument * add NEWS bullet * document() * fix lint, collapse with space fix test expectation Co-authored-by: Michael Chirico <michaelchirico4@gmail.com>
* add name attribute to Linter class fixes #746 * fix test failures * document() * restore 100% coverage for utils.R * deprecate Lint(linter = ...) and remove all calling instances make expect_lint() resilient to complete removal of the argument * add NEWS bullet * document() * fix lint, collapse with space fix test expectation Co-authored-by: Michael Chirico <michaelchirico4@gmail.com>
* add name attribute to Linter class fixes #746 * fix test failures * document() * restore 100% coverage for utils.R * deprecate Lint(linter = ...) and remove all calling instances make expect_lint() resilient to complete removal of the argument * add NEWS bullet * document() * fix lint, collapse with space fix test expectation Co-authored-by: Michael Chirico <michaelchirico4@gmail.com>
* initial formalization of Russ's branch comparison script * tweaks * tweak again * debugging * workaround for Depends * more tweak * skip empty depends * add to buildignore * use optparse * consolidate TODO * add name attribute to Linter class (#753) * add name attribute to Linter class fixes #746 * fix test failures * document() * restore 100% coverage for utils.R * deprecate Lint(linter = ...) and remove all calling instances make expect_lint() resilient to complete removal of the argument * add NEWS bullet * document() * fix lint, collapse with space fix test expectation Co-authored-by: Michael Chirico <michaelchirico4@gmail.com> * typo in optparse funciton skip Depends except on object_usage_linter typo need check higher up forgot to supply arg just exit early if Depends unavailable provide an interactive() experience for debugging tweak * add name attribute to Linter class (#753) * add name attribute to Linter class fixes #746 * fix test failures * document() * restore 100% coverage for utils.R * deprecate Lint(linter = ...) and remove all calling instances make expect_lint() resilient to complete removal of the argument * add NEWS bullet * document() * fix lint, collapse with space fix test expectation Co-authored-by: Michael Chirico <michaelchirico4@gmail.com> * typo * vestigial variable name not working from command line testing more debugging Rscript sucks progress -- we need to skip missing Imports too more progress -- skip on platforms without tcl/tk need testing again need to exit early * skip directories with encoding issues * switch conditions * remove tracing Co-authored-by: AshesITR <alexander.rosenstock@web.de>
Running
lint_package(linters = object_name_linter())
on current master of lintr:and a couple of similar issues.
Note that if the
nolint
comment forLinter
inR/utils.R
is changed, removing the terminal dot:... no lint is thrown for the name
Linter
The text was updated successfully, but these errors were encountered: