-
Couldn't load subscription status.
- Fork 195
brace_linter() covers test_that() without braces #2808
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2808 +/- ##
=======================================
Coverage 99.64% 99.64%
=======================================
Files 127 127
Lines 7068 7078 +10
=======================================
+ Hits 7043 7053 +10
Misses 25 25 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Interestingly I found two odd usages of test_that on GitHub https://github.com/search?q=%2Ftest_that%5C(%5C%7B%2F&type=code
- Piping the test name.
- Supplying the description as a keyword argument.
Both break the positional assumption.
WDYT about supporting one or both?
I don't think it's worth the investment. If eventually we have a good general framework for handling odd cases like that, we can include it in a sweep of all linters. But I also don't see much demand for that besides from us maintainers recognizing we're being less-than-perfect on this front. I see 28 hits there vs. >300,000 for just |
|
Bumping for review :) |
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.
idea + tests look good to me!
wonder if this will catch this
obrl-soil/h3jsr#11 (see what I did to tests here.
test_that("test", x<-1. expect_equal(x, 1), expect_equal(x + 1,2))|
Sorry, I'm not sure what I'm looking at 😅 Your example doesn't parse, and the PR you shared has too much other things going on :) |
|
Sorry, I typed too fast on my phone. See this view instead https://github.com/obrl-soil/h3jsr/pull/11/files?file-filters%5B%5D=.R&show-deleted-files=true&show-viewed-files=true |
|
Can't say I've seen that one before 🫨 |
Closes #2292