You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
delete function_brace_linter and merge it into brace_linter (#1094)
* delete function_brace_linter and merge it into brace_linter
* delete if_else_match_braces_linter and merge it into brace_linter (#1095)
* delete if_else_match_braces_linter and merge it into brace_linter
* deprecate open_curly_linter and merge it into brace_linter (#1096)
* deprecate open_curly_linter
- remove open_curly_linter from defaults
- refactor to XPath based approach
- no longer lint trailing whitespace (there's a separate linter for that)
* merge paren_brace_linter into brace_linter (#1097)
* deprecate paren_brace_linter
- remove paren_brace_linter from defaults
- extend to else{ and repeat{
* `code`
Co-authored-by: Michael Chirico <[email protected]>
* add explicit test for different behaviour compared to closed_curly_linter
Co-authored-by: Michael Chirico <[email protected]>
Co-authored-by: Michael Chirico <[email protected]>
Co-authored-by: Michael Chirico <[email protected]>
Copy file name to clipboardExpand all lines: NEWS.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,11 @@
13
13
+`closed_curly_linter()`, also allowing `}]` in addition to `})` and `},` as exceptions.
14
14
* Combined several curly brace related linters into a new `brace_linter` (#1041, @AshesITR):
15
15
+`closed_curly_linter()`
16
+
+`open_curly_linter()`, no longer linting unnecessary trailing whitespace
17
+
+`paren_brace_linter()`, also linting `if`/`else` and `repeat` with missing whitespace
16
18
+ Require `else` to come on the same line as the preceding `}`, if present (#884, @michaelchirico)
19
+
+ Require functions spanning multiple lines to use curly braces (@michaelchirico)
20
+
+ Require balanced usage of `{}` in `if`/`else` conditions (@michaelchirico)
17
21
* The `...` arguments for `lint()`, `lint_dir()`, and `lint_package()` have promoted to an earlier position to better match the [Tidyverse design principal](https://design.tidyverse.org/args-data-details.html) of data->descriptor->details. This change enables passing objects to `...` without needing to specify non-required arguments, e.g. `lint_dir("/path/to/dir", linter())` now works without the need to specify `relative_path`. This affects some code that uses positional arguments. (#935, @michaelchirico)
18
22
+ For `lint()`, `...` is now the 3rd argument, where earlier this was `cache=`
19
23
+ For `lint_dir()` and `lint_package()`, `...` is now the 2nd argument, where earlier this was `relative_path=`
@@ -119,7 +123,6 @@ function calls. (#850, #851, @renkun-ken)
119
123
*`yoda_test_linter()` Require usage of `expect_identical(x, 1L)` over `expect_equal(1L, x)` and similar
120
124
*`expect_identical_linter()` Require usage of `expect_identical()` by default, and `expect_equal()` only by exception
121
125
*`expect_comparison_linter()` Require usage of `expect_gt(x, y)` over `expect_true(x > y)` and similar
122
-
*`if_else_match_braces_linter()` Require balanced usage of `{}` in `if`/`else` conditions
123
126
*`vector_logic_linter()` Require use of scalar logical operators (`&&` and `||`) inside `if()` conditions and similar
124
127
*`any_is_na_linter()` Require usage of `anyNA(x)` over `any(is.na(x))`
125
128
*`class_equals_linter()` Prevent comparing `class(x)` with `==`, `!=`, or `%in%`, where `inherits()` is typically preferred
@@ -133,7 +136,10 @@ function calls. (#850, #851, @renkun-ken)
133
136
*`nested_ifelse_linter()` Prevent nested calls to `ifelse()` like `ifelse(A, x, ifelse(B, y, z))`, and similar
134
137
*`condition_message_linter` Prevent condition messages from being constructed like `stop(paste(...))` (where just `stop(...)` is preferable)
135
138
*`redundant_ifelse_linter()` Prevent usage like `ifelse(A & B, TRUE, FALSE)` or `ifelse(C, 0, 1)` (the latter is `as.numeric(!C)`)
136
-
*`brace_linter()` Require `else` to come on the same line as the preceding `}`, if present
139
+
* Extensions to `brace_linter()`
140
+
+ Require `else` to come on the same line as the preceding `}`, if present
141
+
+ Require balanced usage of `{}` in `if`/`else` conditions
142
+
+ Require functions spanning multiple lines to use curly braces
137
143
*`unreachable_code_linter()` Prevent code after `return()` and `stop()` statements that will never be reached (extended for #1051 thanks to early user testing, thanks @bersbersbers!)
138
144
*`regex_subset_linter()` Require usage of `grep(ptn, x, value = TRUE)` over `x[grep(ptn, x)]` and similar
139
145
*`consecutive_stopifnot_linter()` Require consecutive calls to `stopifnot()` to be unified into one
0 commit comments