Skip to content

fix delint conflicts - #687

Merged
MichaelChirico merged 21 commits into
masterfrom
delint/fix-delint-conflicts
Dec 6, 2020
Merged

MichaelChirico merged 21 commits into
masterfrom
delint/fix-delint-conflicts

Conversation

@AshesITR

@AshesITR AshesITR commented Dec 6, 2020

Copy link
Copy Markdown
Collaborator

Unfortunately, some newly enabled linters had hits in tests, so we aren't lint-free on master atm.

Comment thread .lintr
linters: with_defaults( # The following TODOs are part of an effort to have {lintr} lint-free (#584)
line_length_linter = line_length_linter(120),
cyclocomp_linter = cyclocomp_linter(29), # TODO reduce to 15
cyclocomp_linter = cyclocomp_linter(30), # TODO reduce to 15

Copy link
Copy Markdown
Collaborator Author

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.

@AshesITR AshesITR changed the title [WIP] fix delint conflicts fix delint conflicts Dec 6, 2020
MichaelChirico
MichaelChirico previously approved these changes Dec 6, 2020
expected_message <- tryCatch(parse(text = "\\"), error = get_base_message)
expect_lint("\\", rex(expected_message))

# also try when LANGUAGE initially unset

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This causes non-english locales to fail the test.

test-exclusions.R was not touched since it contains 3 calls (and will be split by #660)
@AshesITR AshesITR mentioned this pull request Dec 6, 2020
@AshesITR

AshesITR commented Dec 6, 2020

Copy link
Copy Markdown
Collaborator Author

@MichaelChirico can you re-approve? I had a merge conflict and test failure on non-english locale due to Sys.unsetenv() in test-error.R.

@MichaelChirico
MichaelChirico merged commit abf92a4 into master Dec 6, 2020
@MichaelChirico
MichaelChirico deleted the delint/fix-delint-conflicts branch December 6, 2020 18:06
@MichaelChirico

Copy link
Copy Markdown
Collaborator

That Sys.unsetenv was for coverage -- do we know what's the issue exactly?

@AshesITR

AshesITR commented Dec 6, 2020 •

Copy link
Copy Markdown
Collaborator Author

Ah, the problem was that expect_lint automatically sets LANGUAGE = en so the expected error message is actually language-independent.

in hindsight, removing the update of expected_message should have done the job.

@MichaelChirico

Copy link
Copy Markdown
Collaborator

OK, we'll add that back in the future

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.

2 participants