-
Notifications
You must be signed in to change notification settings - Fork 186
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
fix delint conflicts #687
Merged
Merged
fix delint conflicts #687
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
fc52ead
de-lint test-absolute_path_linter.R
AshesITR 5e18a0e
de-lint test-exclusions.R
AshesITR c2f1f2b
de-lint test-extraction_operator_linter.R
AshesITR f12b120
de-lint test-get_source_expressions.R
AshesITR b2cc640
de-lint test-implicit_integer_linter.R
AshesITR 2cecfdc
de-lint test-nonportable_path_linter.R
AshesITR 99cb107
de-lint test-object_name_linter.R
AshesITR 6916ee1
de-lint test-pipe_continuation_linter.R
AshesITR 017902a
de-lint test-semicolon_terminator_linter.R
AshesITR f11b574
de-lint test-settings.R
AshesITR e7d9f28
de-lint test-T_and_F_symbol_linter.R
AshesITR f4d6573
de-lint test-todo_comment_linter.R
AshesITR 025af03
de-lint test-undesirable_function_linter.R
AshesITR 92f6608
Merge branch 'master' into delint/fix-delint-conflicts
AshesITR 92a9fe0
de-lint test-undesirable_operator_linter.R
AshesITR 64a13fb
de-lint test-unneeded_concatenation_linter.R
AshesITR ae955bb
bump cyclocomp limit up to 30 for lint()
AshesITR 7ef94ef
fix test failure on non-english locale
AshesITR 242ab32
fix test failure on non-english locale
AshesITR 0b1fe0b
remove most context() calls in touched files
AshesITR dbf4298
Merge branch 'master' into delint/fix-delint-conflicts
AshesITR File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
context("T_and_F_symbol_linter") | ||
|
||
test_that("returns the correct linting", { | ||
linter <- T_and_F_symbol_linter | ||
msgT <- "Use TRUE instead of the symbol T." | ||
msgF <- "Use FALSE instead of the symbol F." | ||
msg_true <- "Use TRUE instead of the symbol T." | ||
msg_false <- "Use FALSE instead of the symbol F." | ||
expect_lint("FALSE", NULL, linter) | ||
expect_lint("TRUE", NULL, linter) | ||
expect_lint("x <- \"TRUE master vs FALSE slave\"", NULL, linter) | ||
expect_lint("T", list(message=msgT, line_number=1L, column_number=2L), linter) | ||
expect_lint("F", list(message=msgF, line_number=1L, column_number=2L), linter) | ||
expect_lint("T", list(message = msg_true, line_number = 1L, column_number = 2L), linter) | ||
expect_lint("F", list(message = msg_false, line_number = 1L, column_number = 2L), linter) | ||
expect_lint("for (i in 1:10) {x <- c(T, TRUE, F, FALSE)}", | ||
list( | ||
list(message=msgT, line_number=1L, column_number=26L), | ||
list(message=msgF, line_number=1L, column_number=35L) | ||
list(message = msg_true, line_number = 1L, column_number = 26L), | ||
list(message = msg_false, line_number = 1L, column_number = 35L) | ||
), | ||
linter) | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
context("error") | ||
test_that("returns the correct linting", { | ||
expect_lint("\"\\R\"", | ||
rex("is an unrecognized escape in character string starting") | ||
|
@@ -60,11 +59,6 @@ test_that("returns the correct linting", { | |
expected_message <- tryCatch(parse(text = "\\"), error = get_base_message) | ||
expect_lint("\\", rex(expected_message)) | ||
|
||
# also try when LANGUAGE initially unset | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This causes non-english locales to fail the test. |
||
Sys.unsetenv("LANGUAGE") | ||
expected_message <- tryCatch(parse(text = "\\"), error = get_base_message) | ||
expect_lint("\\", rex(expected_message)) | ||
|
||
expect_lint("``", | ||
rex("attempt to use zero-length variable name") | ||
) | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
context("extraction_operator_linter") | ||
|
||
test_that("linter returns the correct linting", { | ||
linter <- extraction_operator_linter | ||
msgB <- rex::escape("Use `[[` instead of `[` to extract an element.") | ||
msgD <- rex::escape("Use `[[` instead of `$` to extract an element.") | ||
msg_b <- rex::escape("Use `[[` instead of `[` to extract an element.") | ||
msg_d <- rex::escape("Use `[[` instead of `$` to extract an element.") | ||
|
||
expect_lint("x[[1]]", NULL, linter) | ||
expect_lint("x[-1]", NULL, linter) | ||
expect_lint("x[1, 'a']", NULL, linter) | ||
expect_lint("self$a", NULL, linter) | ||
expect_lint(".self $\na", NULL, linter) | ||
expect_lint("x$a", list(message=msgD, line_number=1L, column_number=2L), linter) | ||
expect_lint("x $\na", list(message=msgD, line_number=1L, column_number=3L), linter) | ||
expect_lint("x[NULL]", list(message=msgB, line_number=1L, column_number=2L), linter) | ||
expect_lint("x[++ + 3]", list(message=msgB, line_number=1L, column_number=2L), linter) | ||
expect_lint("x$a", list(message = msg_d, line_number = 1L, column_number = 2L), linter) | ||
expect_lint("x $\na", list(message = msg_d, line_number = 1L, column_number = 3L), linter) | ||
expect_lint("x[NULL]", list(message = msg_b, line_number = 1L, column_number = 2L), linter) | ||
expect_lint("x[++ + 3]", list(message = msg_b, line_number = 1L, column_number = 2L), linter) | ||
expect_lint("c(x['a'], x [ 1 ])", | ||
list( | ||
list(message=msgB, line_number=1L, column_number=4L), | ||
list(message=msgB, line_number=1L, column_number=13L) | ||
list(message = msg_b, line_number = 1L, column_number = 4L), | ||
list(message = msg_b, line_number = 1L, column_number = 13L) | ||
), | ||
linter) | ||
}) |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#673 added 1 to the cyclocomp of
lint()
.To keep this separate from removing ~ 200 lints from tests/, I temporarily bump the limit here.