-
Notifications
You must be signed in to change notification settings - Fork 186
How should the exclusions = ...
argument work?
#580
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 flagged this in #539. When working on a related issue (ensuring that files could be excluded by relative-paths; russHyde#2), @joaopmatias noted that the exclusions-handling is different for files defined in the .lintr, compared to those defined in the 'exclusions' argument. The following integration test was added to
We added a full-path and a relative-path to the exclusions. A single lint was expected in the non-excluded lines of the file that was excluded using relative paths. I realise now that we should have had a Happy to have this issue closed if you agree @AshesITR By 'properly', according to the docs, exclusions should be specified relative to an assumed project-root. They can also be specified as full-paths (though this doesn't appear mentioned in the docs). It doesn't specify what will happen when no project-root can be found (should exclusions be relative to the directory passed to 'lint_dir'?) though that's probably a minor issue |
I'd expect exclusions to work relative to the path argument, maybe even regardless of where the project root was. e.g. exclusions in |
I'd be happy with that, I also think that exclusions specified in a .lintr file should be relative to the position of the .lintr file (rather than a project root that may be in a parent directory) and that two different directories could respect different .lintr files (eg, allowing a different line-length in ./docs than in ./scripts). These are quite big changes that differ from the documented function of lintr, so would have to wait until v3 I guess. I'll investigate what happens for a 'free' project (one with no .git, .lintr, or .Rproj) when |
Thanks for doing that. The I'm not even sure what happens atm if Those changes should not have compatibility issues because this is a previously unsupported configuration. |
Follow up to #539.
How should
lint
,lint_dir
andlint_package
handleexclusions
specified through the manual argument?The text was updated successfully, but these errors were encountered: