-
Notifications
You must be signed in to change notification settings - Fork 978
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a follow-up to #6041 that will prevent regression on that front going forward.
- Loading branch information
1 parent
4e48c47
commit b94b7ca
Showing
2 changed files
with
11 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Avoid test(SYMBOL) and test(SYMBOL+...) except in rare cases. | ||
# in the latter case, prefer test(NUMBER+expr). | ||
dt_test_literal_linter <- lintr::make_linter_from_xpath( | ||
" | ||
//SYMBOL_FUNCTION_CALL[text() = 'test'] | ||
/parent::expr | ||
/following-sibling::expr[1][SYMBOL or expr[1]/SYMBOL] | ||
", | ||
"Prefer test's 'num' argument to start with a numeric literal except in rare cases, e.g. test(123, ...) or test(123+x/6, ...)" | ||
) |
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