From 7fa4876a8757fe7498d328cc2bede11153e745b5 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Thu, 5 Sep 2024 23:55:10 +0200 Subject: [PATCH] Remove a few linters from efficiency tag (#2655) * Remove a few linters from efficiency tag closes #2653 * Update NEWS.md * Update NEWS.md Co-authored-by: Michael Chirico --------- Co-authored-by: Michael Chirico --- NEWS.md | 2 ++ inst/lintr/linters.csv | 6 +++--- man/efficiency_linters.Rd | 3 --- man/linters.Rd | 8 ++++---- man/list_comparison_linter.Rd | 2 +- man/undesirable_function_linter.Rd | 2 +- man/undesirable_operator_linter.Rd | 2 +- 7 files changed, 12 insertions(+), 13 deletions(-) diff --git a/NEWS.md b/NEWS.md index d2508f02d..abc0f5c2b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -18,6 +18,8 @@ * `cyclocomp_linter()` is no longer part of the default linters (#2555, @IndrajeetPatil) because the tidyverse style guide doesn't contain any guidelines on meeting certain complexity requirements. Note that users with `cyclocomp_linter()` in their configs may now need to install {cyclocomp} intentionally, in particular in CI/CD pipelines. * `scalar_in_linter` is now configurable to allow other `%in%` like operators to be linted. The data.table operator `%chin%` is no longer linted by default; use `in_operators = "%chin%"` to continue linting it. (@F-Noelle) * `lint()` and friends now normalize paths to forward slashes on Windows (@olivroy, #2613). +* `undesirable_function_linter()`, `undesirable_operator_linter()`, and `list_comparison_linter()` were removed from the tag `efficiency` (@IndrajeetPatil, #2655). If you use `linters_with_tags("efficiency")` to include these linters, you'll need to adjust your config to keep linting your code against them. We did not find any such users on GitHub. + ## Bug fixes diff --git a/inst/lintr/linters.csv b/inst/lintr/linters.csv index 95af98b61..1f070f45f 100644 --- a/inst/lintr/linters.csv +++ b/inst/lintr/linters.csv @@ -52,7 +52,7 @@ length_test_linter,common_mistakes efficiency lengths_linter,efficiency readability best_practices library_call_linter,style best_practices readability configurable line_length_linter,style readability default configurable -list_comparison_linter,best_practices common_mistakes efficiency +list_comparison_linter,best_practices common_mistakes literal_coercion_linter,best_practices consistency efficiency matrix_apply_linter,readability efficiency missing_argument_linter,correctness common_mistakes configurable @@ -108,8 +108,8 @@ terminal_close_linter,best_practices robustness todo_comment_linter,style configurable trailing_blank_lines_linter,style default trailing_whitespace_linter,style default configurable -undesirable_function_linter,style efficiency configurable robustness best_practices -undesirable_operator_linter,style efficiency configurable robustness best_practices +undesirable_function_linter,style configurable robustness best_practices +undesirable_operator_linter,style configurable robustness best_practices unnecessary_concatenation_linter,style readability efficiency configurable unnecessary_lambda_linter,best_practices efficiency readability configurable unnecessary_nested_if_linter,readability best_practices deprecated diff --git a/man/efficiency_linters.Rd b/man/efficiency_linters.Rd index 37cb8b0d7..458375e27 100644 --- a/man/efficiency_linters.Rd +++ b/man/efficiency_linters.Rd @@ -22,7 +22,6 @@ The following linters are tagged with 'efficiency': \item{\code{\link{inner_combine_linter}}} \item{\code{\link{length_test_linter}}} \item{\code{\link{lengths_linter}}} -\item{\code{\link{list_comparison_linter}}} \item{\code{\link{literal_coercion_linter}}} \item{\code{\link{matrix_apply_linter}}} \item{\code{\link{nested_ifelse_linter}}} @@ -38,8 +37,6 @@ The following linters are tagged with 'efficiency': \item{\code{\link{seq_linter}}} \item{\code{\link{sort_linter}}} \item{\code{\link{string_boundary_linter}}} -\item{\code{\link{undesirable_function_linter}}} -\item{\code{\link{undesirable_operator_linter}}} \item{\code{\link{unnecessary_concatenation_linter}}} \item{\code{\link{unnecessary_lambda_linter}}} \item{\code{\link{vector_logic_linter}}} diff --git a/man/linters.Rd b/man/linters.Rd index 394bd6126..50f8baf7d 100644 --- a/man/linters.Rd +++ b/man/linters.Rd @@ -24,7 +24,7 @@ The following tags exist: \item{\link[=correctness_linters]{correctness} (7 linters)} \item{\link[=default_linters]{default} (25 linters)} \item{\link[=deprecated_linters]{deprecated} (6 linters)} -\item{\link[=efficiency_linters]{efficiency} (32 linters)} +\item{\link[=efficiency_linters]{efficiency} (29 linters)} \item{\link[=executing_linters]{executing} (6 linters)} \item{\link[=package_development_linters]{package_development} (14 linters)} \item{\link[=pkg_testthat_linters]{pkg_testthat} (12 linters)} @@ -88,7 +88,7 @@ The following linters exist: \item{\code{\link{lengths_linter}} (tags: best_practices, efficiency, readability)} \item{\code{\link{library_call_linter}} (tags: best_practices, configurable, readability, style)} \item{\code{\link{line_length_linter}} (tags: configurable, default, readability, style)} -\item{\code{\link{list_comparison_linter}} (tags: best_practices, common_mistakes, efficiency)} +\item{\code{\link{list_comparison_linter}} (tags: best_practices, common_mistakes)} \item{\code{\link{literal_coercion_linter}} (tags: best_practices, consistency, efficiency)} \item{\code{\link{matrix_apply_linter}} (tags: efficiency, readability)} \item{\code{\link{missing_argument_linter}} (tags: common_mistakes, configurable, correctness)} @@ -139,8 +139,8 @@ The following linters exist: \item{\code{\link{todo_comment_linter}} (tags: configurable, style)} \item{\code{\link{trailing_blank_lines_linter}} (tags: default, style)} \item{\code{\link{trailing_whitespace_linter}} (tags: configurable, default, style)} -\item{\code{\link{undesirable_function_linter}} (tags: best_practices, configurable, efficiency, robustness, style)} -\item{\code{\link{undesirable_operator_linter}} (tags: best_practices, configurable, efficiency, robustness, style)} +\item{\code{\link{undesirable_function_linter}} (tags: best_practices, configurable, robustness, style)} +\item{\code{\link{undesirable_operator_linter}} (tags: best_practices, configurable, robustness, style)} \item{\code{\link{unnecessary_concatenation_linter}} (tags: configurable, efficiency, readability, style)} \item{\code{\link{unnecessary_lambda_linter}} (tags: best_practices, configurable, efficiency, readability)} \item{\code{\link{unnecessary_nesting_linter}} (tags: best_practices, configurable, consistency, readability)} diff --git a/man/list_comparison_linter.Rd b/man/list_comparison_linter.Rd index 9a939a686..736e78256 100644 --- a/man/list_comparison_linter.Rd +++ b/man/list_comparison_linter.Rd @@ -29,5 +29,5 @@ lint( \link{linters} for a complete list of linters available in lintr. } \section{Tags}{ -\link[=best_practices_linters]{best_practices}, \link[=common_mistakes_linters]{common_mistakes}, \link[=efficiency_linters]{efficiency} +\link[=best_practices_linters]{best_practices}, \link[=common_mistakes_linters]{common_mistakes} } diff --git a/man/undesirable_function_linter.Rd b/man/undesirable_function_linter.Rd index 1a73f29ce..bfcbd947d 100644 --- a/man/undesirable_function_linter.Rd +++ b/man/undesirable_function_linter.Rd @@ -68,5 +68,5 @@ lint( \link{linters} for a complete list of linters available in lintr. } \section{Tags}{ -\link[=best_practices_linters]{best_practices}, \link[=configurable_linters]{configurable}, \link[=efficiency_linters]{efficiency}, \link[=robustness_linters]{robustness}, \link[=style_linters]{style} +\link[=best_practices_linters]{best_practices}, \link[=configurable_linters]{configurable}, \link[=robustness_linters]{robustness}, \link[=style_linters]{style} } diff --git a/man/undesirable_operator_linter.Rd b/man/undesirable_operator_linter.Rd index 18bc5722b..2f1188116 100644 --- a/man/undesirable_operator_linter.Rd +++ b/man/undesirable_operator_linter.Rd @@ -52,5 +52,5 @@ lint( \link{linters} for a complete list of linters available in lintr. } \section{Tags}{ -\link[=best_practices_linters]{best_practices}, \link[=configurable_linters]{configurable}, \link[=efficiency_linters]{efficiency}, \link[=robustness_linters]{robustness}, \link[=style_linters]{style} +\link[=best_practices_linters]{best_practices}, \link[=configurable_linters]{configurable}, \link[=robustness_linters]{robustness}, \link[=style_linters]{style} }