You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lintr can be used in several settings: precommit, CI, interactively etc
I found that when using lintr in precommit, object-usage was throwing a lot of false positives. This arose because only the commit set gets linted, so if you are lint()ing a file that refers to an object defined elsewhere in the package, lintr assumes that object doesn't exist.
In CI, I can load the package prior to linting it - taking care of any object-usage lints.
But I can't easily load the package in precommit because that would require adding all my package's dependencies to the env where the lintr hook runs.
So I was wondering whether there is a way to conditionally specify whether a linter is active, e.g. based on environment variables:
lintr can be used in several settings: precommit, CI, interactively etc
I found that when using lintr in precommit, object-usage was throwing a lot of false positives. This arose because only the commit set gets linted, so if you are lint()ing a file that refers to an object defined elsewhere in the package, lintr assumes that object doesn't exist.
In CI, I can load the package prior to linting it - taking care of any object-usage lints.
But I can't easily load the package in precommit because that would require adding all my package's dependencies to the env where the lintr hook runs.
So I was wondering whether there is a way to conditionally specify whether a linter is active, e.g. based on environment variables:
Is there a neater way to encode conditions under which the configured linters should run?
The text was updated successfully, but these errors were encountered: