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

Make failure message of expect_lint_free() more actionable #1784

Closed
AshesITR opened this issue Dec 1, 2022 · 1 comment · Fixed by #1790
Closed

Make failure message of expect_lint_free() more actionable #1784

AshesITR opened this issue Dec 1, 2022 · 1 comment · Fixed by #1790

Comments

@AshesITR
Copy link
Collaborator

AshesITR commented Dec 1, 2022

Currently, if expect_lint_free() fails, the message is

Not lint free

Which, while correct, isn't very helpful and requires another lintr run to find out where the lints are.
Instead, we should show the first couple of lints in the message, e.g.

Number of lints (42) not equal to 0.

[output of print.lints(head(lints, 10L))]

and 32 more...

Compare expect_equal(1:100, numeric()):

1:100 (actual) not equal to numeric() (expected).

actual: 1 2 3 4 5 6 7 8 9 10 and 90 more...
expected: ...

@AshesITR
Copy link
Collaborator Author

AshesITR commented Dec 3, 2022

I noticed this behavior depends on the environment expect_lint_free() runs in.
#1790 solves this problem by exposing a way to always use the "raw" formatting option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant