Comments (4)
Thanks @joelnitta. The difference is probably due to the way {lintr} is called. We don't your whole source package prior to calling {lintr}, but we only lint the files staged for commit. This is arguably different from what you do when you call {lintr} interactively. Please see #440.
from precommit.
@lorenzwalthert it certainly looks like you are right - I think I've encountered the same thing as #440. There's one thing I don't understand though: It looks like {precommit} calls lintr::lint(path), but when I run lintr::lint("path_to_R_script")
I don't get any [object_usage_linter]
warnings like I do from {precommit}.
from precommit.
Ok. Make sure to not devtools::load_all()
before the {lintr} call. But have you tried also outside RStudio like
Rscript -e "lintr::lint(path)"
With the same result? I think maybe {lintr} runs devtools::load_all()
in RStudio or something like this. cc: @russHyde.
from precommit.
Ah, that does make the difference. I'm not using RStudio (I use vs-code), but if I run lintr::lint("path")
in a fresh R session I get the object_usage_linter
warnings; if I run devtools::load_all()
first, no warnings. So yes this is the same thing. Closing now since it's a duplicate of #440.
from precommit.
Related Issues (20)
- Feature: allow package-loading prior to lint hook HOT 17
- Rscript not found HOT 35
- File editing suggestions presumably points to a wrong filename HOT 2
- The defaults are seemingly different in different format checkers HOT 4
- New hook: cff HOT 15
- FR: Run `urlchecker::url_update()` to fix link rot? HOT 5
- FR: Add a pre-commit hook for YAML formatting HOT 2
- Catch up with pre-commit.ci lite HOT 6
- consider using other cran mirror HOT 7
- Child Rmd documents pose problems for parsable-R hook? HOT 2
- Typo in available-hooks.Rmd for lintr warn arg HOT 1
- Error during environment installation. HOT 11
- Roxygenize hook only looks at MRAN; alternative CRAN repos are not specifiable HOT 1
- Error: object 'never' not found on git commit HOT 10
- Different CRAN repositories for different platforms HOT 1
- precommit environment cannot be set up HOT 32
- CI fails for miniconda on Windows HOT 1
- precommit deps-in-desc hook failing after upgrade to R 4.3.0 in renv locked package HOT 12
- Don't rely on any GitHub Packages due to credential issues
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from precommit.