Skip to content

Enable tests #669

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

Merged
merged 5 commits into from
Dec 6, 2020
Merged

Enable tests #669

merged 5 commits into from
Dec 6, 2020

Conversation

MichaelChirico
Copy link
Collaborator

Closes #668

pc <- lapply(get_source_expressions(f)[["expressions"]], `[[`, "parsed_content")
eval(substitute(code))
content_env <- new.env()
content_env$pc <- lapply(get_source_expressions(f)[["expressions"]], `[[`, "parsed_content")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is because pc was seen as an "unused variable"

@@ -88,7 +88,7 @@ test_that("lint() results do not depend on the position of the .lintr", {
)
)

lints_with_config_in_source_dir <- withr::with_dir(
lints_with_config_in_r_dir <- withr::with_dir(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

long variable name


# Template packages for use in testing are stored in
# `tests/testthat/dummy_packages/<pkgName>`
# tests/testthat/dummy_packages/<pkgName>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these were all dinged by commented_code_linter

# When called from inside a package:
# lint_package(".")
# lint_package(".") # nolint
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be a good idea to # nolint this according to the new #660 syntax once we settle on a final default.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about a follow-up issue for tagging all # nolints in the package that way?

./R/closed_curly_linter.R:                    message = "Closing curly-braces should always be on their own line, unless it's followed by an else.", # nolint
./R/function_left_parentheses.R:function_left_parentheses_linter <- function(source_file) { # nolint: function_left_parentheses_linter.
./R/get_source_expressions.R:    })(prev_locs == lag(next_locs)) # nolint
./R/open_curly_linter.R:                    message = "Opening curly braces should never go on their own line and should always be followed by a new line.", # nolint
./R/lint.R:        expr_lints <- flatten_lints(linters[[linter]](expr)) # nolint
./tests/testthat/test-deprecated.R:  expect_quiet_lint("'/blah/file.txt'", # nolint
./tests/testthat/test-lint_package.R:# lint_package(".") # nolint
./tests/testthat/test-lint_package.R:# lint_package(path_to_package) # nolint
./tests/testthat/test-rstudio_markers.R:  expect_equal(marker3$basePath, "test") # nolint

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good 👍

Copy link
Collaborator

@AshesITR AshesITR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@AshesITR AshesITR merged commit 20d37fa into master Dec 6, 2020
@AshesITR AshesITR deleted the enable-tests branch December 6, 2020 09:34
@AshesITR AshesITR mentioned this pull request Dec 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make tests/ conform to all linters
2 participants