From 2ecaac072d24c4e17157aa2162ed91c5bdab489b Mon Sep 17 00:00:00 2001 From: "Sebastian Mellor (Jumping Rivers)" <74551507+sjimellor-jr@users.noreply.github.com> Date: Sat, 10 Apr 2021 19:25:41 +0100 Subject: [PATCH] Exclude packrat and renv from linting as well (#42) --- DESCRIPTION | 2 +- NEWS.md | 3 +++ R/check_lintr.R | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 48d73e1..8f564f1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: inteRgrate Title: Opinionated Package Coding Styles -Version: 1.0.16 +Version: 1.0.17 Authors@R: person(given = "Jumping", family = "Rivers", diff --git a/NEWS.md b/NEWS.md index 0b924bb..1340f1f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +# inteRgrate 1.0.17 _2021-04-10_ + * Add more exclusions (again) + # inteRgrate 1.0.16 _2021-04-07_ * Fix exclusions parsing (again!) diff --git a/R/check_lintr.R b/R/check_lintr.R index 2bcfbb8..a7d9abf 100644 --- a/R/check_lintr.R +++ b/R/check_lintr.R @@ -1,9 +1,9 @@ get_exclusions = function() { - if (!file.exists(".lintr")) return(c("^R/|^cache/")) + if (!file.exists(".lintr")) return(c("^R/|^cache/|^packrat/|^renv/")) exclusions = read.dcf(".lintr", all = TRUE)$exclusions - if (is.null(exclusions)) return(c("^R/|^cache/")) + if (is.null(exclusions)) return(c("^R/|^cache/|^packrat/|^renv/")) exclusions = stringr::str_split(exclusions, ",")[[1]] exclusions = stringr::str_remove(exclusions, "list\\W?\\(") exclusions = stringr::str_remove(exclusions, "\\)$") @@ -11,7 +11,7 @@ get_exclusions = function() { exclusions = stringr::str_remove_all(exclusions, ("^\"|\"$")) ## Convert to regular expression - pattern = paste0(c(exclusions, "^R/", "^cache/"), collapse = "|") + pattern = paste0(c(exclusions, "^R/", "^cache/", "^packrat/", "^renv/"), collapse = "|") return(pattern) }