Skip to content
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

allow config to be an .R file #2177

Merged
merged 54 commits into from
Oct 3, 2023
Merged
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
83ccca5
allow config to be an .R file
MichaelChirico Sep 15, 2023
637d6c9
Merge branch 'main' into lintr-r-config
MichaelChirico Sep 15, 2023
0f98c6e
parse DCF values inside read_config_file
MichaelChirico Sep 15, 2023
458d1f0
Merge branch 'lintr-r-config' of github.com:r-lib/lintr into lintr-r-…
MichaelChirico Sep 15, 2023
f439309
dont keep source
MichaelChirico Sep 15, 2023
d0d987e
correction
MichaelChirico Sep 15, 2023
d19b120
Merge branch 'main' into lintr-r-config
MichaelChirico Sep 15, 2023
428cddb
oops
MichaelChirico Sep 15, 2023
94d13df
backport sys.source args, remove unneeded backports
MichaelChirico Sep 15, 2023
55c6287
oops
MichaelChirico Sep 15, 2023
a35412e
need placeholder initiated in namespace
MichaelChirico Sep 16, 2023
ebf2462
formalArgs needs ns-qualification
MichaelChirico Sep 17, 2023
dbe2268
nvm, avoid new Imports even if we implicitly have this dependency
MichaelChirico Sep 17, 2023
a14bed1
Alternative to pass R CMD check on R3.5.0
MichaelChirico Sep 17, 2023
9e978d9
return environment for DCF too
MichaelChirico Sep 18, 2023
2b8cc9e
better use exists() for env
MichaelChirico Sep 18, 2023
6b53d80
missing comma
MichaelChirico Sep 18, 2023
54d87f7
is.null() simpler for case when config is empty
MichaelChirico Sep 18, 2023
3c50582
we don't allow that here
MichaelChirico Sep 18, 2023
edd0d2d
Merge branch 'main' into lintr-r-config
MichaelChirico Sep 19, 2023
25d6dbd
Merge branch 'main' into lintr-r-config
IndrajeetPatil Sep 20, 2023
2c800b3
simplify with %||%
MichaelChirico Sep 20, 2023
adcbfdf
helper for more parallelism
MichaelChirico Sep 20, 2023
1245104
use helper elsewhere
MichaelChirico Sep 20, 2023
588d178
NEWS
MichaelChirico Sep 20, 2023
dcdb994
document in ?read_settings
MichaelChirico Sep 20, 2023
765e810
extend %||%
MichaelChirico Sep 20, 2023
fa1d676
check in test package
MichaelChirico Sep 20, 2023
da8559b
length<0 impossible
MichaelChirico Sep 20, 2023
cab3234
Merge branch 'main' into lintr-r-config
MichaelChirico Sep 21, 2023
3c2207d
simplify finding local settings
MichaelChirico Sep 21, 2023
f0aa186
missed conflict
MichaelChirico Sep 21, 2023
0960758
shared logic in helper
MichaelChirico Sep 21, 2023
79584a9
Merge branch 'simplify-find-config' into lintr-r-config
MichaelChirico Sep 21, 2023
029cb88
working test!
MichaelChirico Sep 21, 2023
1862e28
windows-friendly
MichaelChirico Sep 21, 2023
7b9071a
test of invalid syntax
MichaelChirico Sep 21, 2023
ebd294a
test another setting
MichaelChirico Sep 21, 2023
f7da8f8
test with extraneous info
MichaelChirico Sep 21, 2023
3b109c7
test of config priority
MichaelChirico Sep 21, 2023
108c45e
Merge remote-tracking branch 'origin/main' into lintr-r-config
MichaelChirico Sep 21, 2023
1676536
Merge remote-tracking branch 'origin/main' into lintr-r-config
MichaelChirico Oct 1, 2023
e938475
mention .lintr.R in docs
MichaelChirico Oct 1, 2023
9712e7a
test on subprocess without lintr attached
MichaelChirico Oct 1, 2023
5d2b773
restore change from another branch
MichaelChirico Oct 1, 2023
438cbdd
correct invocation of Rscript
MichaelChirico Oct 1, 2023
d5cfa39
object_name_linter
MichaelChirico Oct 1, 2023
1f3c6d3
skip on windows
MichaelChirico Oct 1, 2023
ee62da7
skip non-robust test
MichaelChirico Oct 1, 2023
589b54b
another try
MichaelChirico Oct 1, 2023
211bd64
skip on 3.5
MichaelChirico Oct 1, 2023
1e36799
Merge branch 'main' into lintr-r-config
MichaelChirico Oct 2, 2023
5ae8a9a
change precedence to R>DCF, simplify
MichaelChirico Oct 2, 2023
58e3487
Merge branch 'main' into lintr-r-config
MichaelChirico Oct 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions tests/testthat/test-lint_package.R
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,17 @@ test_that("package using .lintr.R config lints correctly", {
expect_identical(unique(basename(lints$filename)), "testthat.R")
expect_identical(lints$linter, c("expect_null_linter", "trailing_blank_lines_linter"))
})

test_that("lintr need not be attached for .lintr.R configs to use lintr functions", {
exprs <- paste(
'options(lintr.linter_file = "lintr_test_config")',
sprintf('lints <- lintr::lint_package("%s")', test_path("dummy_packages", "RConfig")),
# simplify output to be read from stdout
'cat(paste(as.data.frame(lints)$linter, collapse = "|"), "\n", sep = "")',
sep = "; "
)
expect_identical(
system2("Rscript", c("-e", shQuote(exprs)), stdout = TRUE),
AshesITR marked this conversation as resolved.
Show resolved Hide resolved
"infix_spaces_linter|any_duplicated_linter"
)
})