Skip to content
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

Catch unreadable files early with warning #2506

Closed
wants to merge 5 commits into from
Closed

Conversation

MichaelChirico
Copy link
Collaborator

Closes #1939

@codecov-commenter
Copy link

codecov-commenter commented Dec 22, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ccdb186) 98.54% compared to head (033150e) 98.55%.
Report is 2 commits behind head on main.

❗ Current head 033150e differs from pull request most recent head 05877ae. Consider uploading reports for the commit 05877ae to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2506   +/-   ##
=======================================
  Coverage   98.54%   98.55%           
=======================================
  Files         126      126           
  Lines        5720     5729    +9     
=======================================
+ Hits         5637     5646    +9     
  Misses         83       83           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AshesITR
Copy link
Collaborator

Why should we just warn instead of stopping?

@MichaelChirico
Copy link
Collaborator Author

Why should we just warn instead of stopping?

what I had in mind is a directory of scripts where one doesn't have the right permissions. Better to just skip the one file than stop midway.

@AshesITR
Copy link
Collaborator

Seems to me that access rights should then be checked by lint_dir instead of lint.

@MichaelChirico
Copy link
Collaborator Author

Seems to me that access rights should then be checked by lint_dir instead of lint.

maybe, but after #2135 it will wind up back in lint() I reckon.

Shall we table this PR for now then?

@AshesITR
Copy link
Collaborator

Not sure that will happen, actually.
But sounds okay if there is no immediate pain.

Even with vectorized lint I feel access checking doesn't belong there. lint_dir(path, skip_inaccessible = TRUE), which should be non-default imo, could do files <- files[vapply(files, \(x) file.access(x, 4L) != -1, logical(1L))] if requested by the caller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lint_dir() should be cognizant of read permissions
3 participants