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
Update sprintf_linter() to lint constant strings (#2894)
* Update sprintf_linter() tests to lint constant strings
* Factor out fmt_by_name_xpath
* Do not test for string fmt in in_pipe_xpath
* Add lint to detect constant strings in sprintf
* Fix constant sprintf call() in lintr codebase
* Simplify call_xpath()
Since it is now handled by !is.na(fmt)
* Use fmt_by_name_xpath directly without assigning
* Remove nested ifelse()
* Add example for new lint
* Remove unnecessary glue() call
* Use expect_no_lint() where appropriate
* Add test for constant '%'
* Test and handle %% case better
* Use actual function name in lint message
* Convert one more expect_lint(, NULL, )
* Support comments at various positions
* Use action/reason format for message
* Use dedicated xp_call_name() function to get fct_name
* Document new sprintf_linter() lints in NEWS
* one line in NEWS
---------
Co-authored-by: Michael Chirico <[email protected]>
Copy file name to clipboardExpand all lines: NEWS.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,7 @@
47
47
*`fixed_regex_linter()` recognizes usage of the new (R 4.5.0) `grepv()` wrapper of `grep()`; `regex_subset_linter()` also recommends `grepv()` alternatives (#2855, @MichaelChirico).
48
48
*`object_usage_linter()` lints missing packages that may cause false positives (#2872, @AshesITR)
49
49
* New argument `include_s4_slots` for the `xml_find_function_calls()` entry in the `get_source_expressions()` to govern whether calls of the form `s4Obj@fun()` are included in the result (#2820, @MichaelChirico).
50
+
*`sprintf_linter()` lints `sprintf()` and `gettextf()` calls when a constant string is passed to `fmt` (#2894, @Bisaloo).
0 commit comments