Skip to content

Commit

Permalink
Exclude packrat and renv from linting as well (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjimellor-jr authored Apr 10, 2021
1 parent 6c7d0c4 commit 2ecaac0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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!)

Expand Down
6 changes: 3 additions & 3 deletions R/check_lintr.R
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
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, "\\)$")
exclusions = stringr::str_squish(exclusions)
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)
}

Expand Down

0 comments on commit 2ecaac0

Please sign in to comment.