inbo / checklist

An R package for checking R packages and R code
https://inbo.github.io/checklist
GNU General Public License v3.0
16 stars 2 forks source link

nonportable_path_linter false positives #80

Closed hansvancalster closed 2 years ago

hansvancalster commented 2 years ago

I'm seeing lots of Use file.path() to construct portable file paths errors coming from checklist::check_package() or checklist::check_source() -> checklist::check_lintr() -> lintr::lint_package() or lintr::lint_dir()-> lintr::lint().

As noted in this issue and your own issue, these are often false positives. The suggested solution in the latter issue is adding #nolint: absolute_path_linter. In my mind, these false positives are bugs that should be addressed in the code of the absolute_path_linter or nonportable_path_linter (not sure if both are responsible), so I'm curious to know why you suggested that solution rather than a fix that would exclude as much false positives as possible. Is it because a bugfix is (far from) non-trivial for this problem (too many exceptions that need to be regexp'd)?

ElsLommelen commented 2 years ago

Would it be possible to allow users to disable this lintr in checklist as long as it gives a lot of false positives? To me it seems to be less important to impose all INBO users to meet this requirement, considered the fact that they have to deal additionally with all the exceptions that lintr marks uncorrectly.

ThierryO commented 2 years ago

I"ve disabled the non_portable_path_linter in 8501b2b.

ElsLommelen commented 2 years ago

I suppose this change (disabled non_portable_path_linter) is not yet active in GHAs that were set up using checklist? I was almost adding a new issue to report the same problem... ;-)