-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow config to be an .R file (#2177)
- Loading branch information
1 parent
57db3b9
commit 9c49c6e
Showing
19 changed files
with
179 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Package: RConfig | ||
Version: 0.0.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# config excludes assignment_linter() so this doesn't lint | ||
a = 1 | ||
# default config includes infix_spaces_linter() so this lints | ||
b=a + 2 | ||
# config extends defaults with any_duplicated_linter() so this lints | ||
any(duplicated(b)) | ||
# custom exclude setting is also picked up so this doesn't lint | ||
1+1 # NOLINT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
linters <- linters_with_defaults( | ||
any_duplicated_linter(), | ||
assignment_linter = NULL | ||
) | ||
exclude <- "# NOLINT" | ||
exclusions <- list("tests/testthat.R") |
6 changes: 6 additions & 0 deletions
6
tests/testthat/dummy_packages/RConfig/lintr_test_config_conflict
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
linters: linters_with_defaults( | ||
any_duplicated_linter(), | ||
assignment_linter = NULL | ||
) | ||
exclude: "# NOLINT" | ||
exclusions: list("tests/testthat.R") |
6 changes: 6 additions & 0 deletions
6
tests/testthat/dummy_packages/RConfig/lintr_test_config_conflict.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
linters <- linters_with_defaults( | ||
expect_null_linter(), | ||
assignment_linter = NULL | ||
) | ||
exclude <- "# SKIP_LINT" | ||
exclusions <- list("R/lint_me.R") |
12 changes: 12 additions & 0 deletions
12
tests/testthat/dummy_packages/RConfig/lintr_test_config_extraneous.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# here are some extraneous variables that are not part of the config directly | ||
|
||
non_default_linter <- any_duplicated_linter() | ||
attr(non_default_linter, "name") <- "any_duplicated_linter" | ||
excluded_files <- "tests/testthat.R" | ||
|
||
linters <- linters_with_defaults( | ||
non_default_linter, | ||
assignment_linter = NULL | ||
) | ||
exclude <- "# NOLINT" | ||
exclusions <- list(excluded_files) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# This file is in 'exclusions' & nothing lints under R config. | ||
# Under DCF config, '# SKIP_LINT' is the exclusion & this line won't lint | ||
1+1 # SKIP_LINT | ||
# This is included as a linter in the DCF, thus this should lint | ||
expect_equal(foo(x), NULL) | ||
|
||
# trailing blank line next will lint under DCF | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Package: RConfigInvalid | ||
Version: 0.0.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
a <- 1 |
2 changes: 2 additions & 0 deletions
2
tests/testthat/dummy_packages/RConfigInvalid/lintr_test_config.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# invalid R syntax | ||
1 + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters