-
Notifications
You must be signed in to change notification settings - Fork 185
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
Too many absolute_paths_linters false positives #199
Comments
Yes too many false positives is why I removed the absolute paths linter from the defaults 97b23de. |
I had a go at implementing what I suggested above:
I then just added an All these additional test cases pass, and the false positives in my own package went away.
Please consider including this code. We cannot do a perfect job of detecting all valid paths, but this should get rid of many false positives. |
I'm curious to know why absolute paths seem to be frowned upon. R itself occasionally uses them, for example utils::sessionInfo hard-codes "/etc/os-release" and "/etc/system-release", base::Sys.timezone hard-codes "/etc/localtime", etc |
I think it is because they are not portable, tyner. Though as you noted, there are unusual cases where you need absolute paths. |
Fixed in #214. Use |
Hi Jim,
This issue is related to issue #58.
I get quite a few false positives from the absolute path linter. The strings that generated the lints look like: "/aS: 3\n/bS: Inf\n/cS: -2.2\n/dS: x" and to me, the offending character is "\n" which is highly unlikely to be included in a file path. I envison that the linter should:
The problem then boils down to which characters should be forbidden in Linux and Windows paths. These webpages (http://stackoverflow.com/questions/1976007/what-characters-are-forbidden-in-windows-and-linux-directory-names, https://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words) make it clear that it is list them and on Linux, almost all characters are allowed. But a pragmatic approach may be to blacklist:
*
?
"
<
>
|
\0
\a
\n
etcCheers,
Florent
The text was updated successfully, but these errors were encountered: