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

use_lintr adds .lintr to .Rbuildignore #2396

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
debug: Test sub-functions in test II
MEO265 committed Dec 8, 2023
commit 302782edcc7d5b9e9f6522a6eb4b561782d0b2f9
6 changes: 4 additions & 2 deletions tests/testthat/test-use_lintr.R
Original file line number Diff line number Diff line change
@@ -89,11 +89,13 @@
expect_identical(readLines(ignore), c("^fu$", "^bar$", "^\\.lintr$"))
})

test_that("use_lintr handles missing final new line", {

Check warning on line 92 in tests/testthat/test-use_lintr.R

GitHub Actions / lint

file=tests/testthat/test-use_lintr.R,line=92,col=55,[brace_linter] Opening curly braces should never go on their own line and should always be followed by a new line.
path <- withr::local_tempdir()

Check warning on line 93 in tests/testthat/test-use_lintr.R

GitHub Actions / lint

file=tests/testthat/test-use_lintr.R,line=93,col=2,[indentation_linter] Indentation should be 0 spaces but is 2 spaces.
file.create(file.path(path, "DESCRIPTION"))
config_file <- normalizePath(file.path(path, lintr_option("linter_file")), mustWork = FALSE, winslash = "/")
pkg_path <- normalizePath(path, mustWork = FALSE, winslash = "/")
config_file <- normalizePath(file.path(path, lintr_option("linter_file")), mustWork = TRUE, winslash = "/")
pkg_path <- normalizePath(path, mustWork = TRUE, winslash = "/")
warning(config_file, call. = FALSE
warning(pkg_path, call. = FALSE)

Check warning on line 98 in tests/testthat/test-use_lintr.R

GitHub Actions / lint

file=tests/testthat/test-use_lintr.R,line=98,col=3,[error] unexpected symbol
expect_true(startsWith(config_file, prefix = pkg_path))
expect_true(file.exists(file.path(path, "DESCRIPTION")))
})