Comments (1)
Hi @jeancochrane, thanks for the detailed and well-linked issue, haven't seen anything alike for a while 👍
Let's first talk about potential fixes:
It looks like a try_fetch call was added in r-lib/styler@54df59b and released in v1.10.3 in an attempt to suppress the error; I believe that we're still seeing the error in our precommit calls because precommit is pinned to 1.10.2, so one possible solution would be to just bump styler to 1.10.3 in precommit.
Yes, everything correct. You can also use it by adding r-lib/styler@ v1.10.3
as an additional_dependencies
to your .pre-commit-config.yaml
. I will probably at some point release a new hook release to include the latest {styler} version.
Now about the root cause:
While I'm not totally sure of this root cause analysis, I do feel confident that the problem is due to some sort of race condition in the getCachePath() call in remove_old_cache_files
In that case, I think it would be best solved in the {R.cache} package, since {styler} is only leveraging that infrastructure. I am not sure how deep you deep you digged but the issue I opened in {R.cache} is this one: HenrikBengtsson/R.cache#51. I guess as you say, getCachePath()
is potentially not designed to work in a parallel setup, so creating a reprex with the failure that only involves {R.cache} might be a good starting point. Alternatively, just implement logic to make it work in parallel is another.
I expect it could be resolved pretty easily by switching to an alternative way of constructing that directory path that doesn't create the directory, like file.path(tools::R_user_dir("R.cache", which = "cache"), "styler", styler_version)
I would not want to do that since I prefer to use the public API of {R.cache} to interact with the cache. In particular if {R.cache} changes its internals, the above code won't potentially give me the correct path to the cache.
from precommit.
Related Issues (20)
- xfun-0.40 fails to build under Windows HOT 3
- Use frozen PPM snapshots
- specific package not available from MRAN - what would be the next step? HOT 4
- Failure with dev (now CRAN) roxygen2 HOT 1
- Executable `Rscript` not found in VS Code HOT 11
- Convoluted hook testing infra
- Failure with dev pkgdown HOT 5
- New hook: parsable-roxygen HOT 2
- Integration test hook dependency test fails on R 4.4
- `pip install pre-commit --user` gives error in CI on macOS
- Changing the R version breaks the pre-commit cache HOT 2
- Add `.qmd` files to lintr hook
- Use `spelling::update_wordlist()` instead of custom logic to update the wordlist for spell check
- Environment setup fails due to a hardcoded snapshot RSPM link in renv.lock HOT 6
- Failure with recently released pkgdown HOT 2
- How do I wrap markdown in my .qmd files? HOT 5
- Reduce CRAN check time for Windows HOT 1
- Check roxygen code example as well with deps-in-desc hook
- style-files fails with unused arguments HOT 12
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.