-
Notifications
You must be signed in to change notification settings - Fork 27
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
Support loading check.env #160
Conversation
Closes #12.
Codecov Report
@@ Coverage Diff @@
## master #160 +/- ##
==========================================
+ Coverage 80.85% 81.50% +0.65%
==========================================
Files 18 19 +1
Lines 914 984 +70
==========================================
+ Hits 739 802 +63
- Misses 175 182 +7
Continue to review full report at Codecov.
|
} | ||
} | ||
|
||
load_env_file <- function(path, envir = parent.frame()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this use readRenviron()
instead of using our own implementation?
I guess the downside would be restoring the old envvars afterwards. But you could do Sys.getenv()
to save them beforehand I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really like its way of handling errors, it just ignores them, and especially on a CI, it is better to know about them.
So it was easier to copy this code from another package of mine.
But I don't really mind, we can switch to readRenviron()
as well.
This doesn't completely capture what I was looking for, which is some way to disable a standard set of notes that we don't think is important. i.e. this looks useful, but doesn't directly solve the problem I care about. |
I would wary about always ignoring these notes. E.g. the size note is definitely useful sometimes. With the But we can have that as well. Do you want to make it opt-in or opt-out? We can have a |
It is better in tools/ because then it is not installed with the package.
@hadley now you can set
in
Is this closer to what you had in mind? |
- Always convert output to UTF-8. - Use the <xx> notation for bytes that are invalid in the native encoding. Closes #152.
Yeah, that's better. We can then change the Then this PR just needs a bit of documentation so it's easy to find out these two ways of suppressing notes. |
If the file is there, then load it, unless opt out.
@hadley @jimhester I have added some docs. I also removed the dependence on |
I think we might still need to have some sort of non envvar based allow list. Even though CRAN has been adding more fine grained ennvars lately older versions of R won't have this, so we will still get false positive NOTES on those versions. This would preclude us from changing the default to failing on NOTEs for our action
We are currently at 3.4 as the last version we are including in the checks, so it will still be awhile before we could use this unconditionally. |
As for the one for GNU make, yeah, that is a pity. But if it is the only one, then maybe it is not worth implementing a(nother) ignore mechanism for this single one. We do use GNU make in a number of repos, so in these we could have |
Ah, yes you are right about |
@jimhester So do your think that it would be OK to add support for the Unfortunately it is hard to do an ignore-list properly. |
yeah I think that is the best solution for now, we can maybe just fall back to using |
Will add docs...
Closes #12.