Skip to content

Commit

Permalink
[ci] [R-package] Add a few more linters (microsoft#5311)
Browse files Browse the repository at this point in the history
* [ci] Fix any_is_na linter key

* [ci] Add several linter checks (microsoft#5303)

Includes following linters

- any_duplicated_linter()
- inner_combine_linter()
- literal_coercion_linter()
- missing_argument_linter()
- numeric_leading_zero_linter()
- outer_negation_linter()
- package_hooks_linter()
- sprintf_linter()
- regex_subset_linter()
- unreachable_code_linter()
- vector_logic_linter()

These required no changes to the code base
  • Loading branch information
CuriousCorrelation authored Jun 20, 2022
1 parent ef469d8 commit aaac829
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .ci/lint_r_code.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ interactive_text <- paste0(

LINTERS_TO_USE <- list(
"absolute_path" = lintr::absolute_path_linter()
, "any_is_na_linter" = lintr::any_is_na_linter()
, "any_duplicated" = lintr::any_duplicated_linter()
, "any_is_na" = lintr::any_is_na_linter()
, "assignment" = lintr::assignment_linter()
, "braces" = lintr::brace_linter()
, "class_equals_linter" = lintr::class_equals_linter()
Expand All @@ -39,18 +40,28 @@ LINTERS_TO_USE <- list(
, "function_left" = lintr::function_left_parentheses_linter()
, "implicit_integers" = lintr::implicit_integer_linter()
, "infix_spaces" = lintr::infix_spaces_linter()
, "inner_combine" = lintr::inner_combine_linter()
, "literal_coercion" = lintr::literal_coercion_linter()
, "long_lines" = lintr::line_length_linter(length = 120L)
, "missing_argument" = lintr::missing_argument_linter()
, "no_tabs" = lintr::no_tab_linter()
, "non_portable_path" = lintr::nonportable_path_linter()
, "numeric_leading_zero" = lintr::numeric_leading_zero_linter()
, "outer_negation" = lintr::outer_negation_linter()
, "package_hooks" = lintr::package_hooks_linter()
, "regex_subset" = lintr::regex_subset_linter()
, "semicolon" = lintr::semicolon_linter()
, "seq" = lintr::seq_linter()
, "single_quotes" = lintr::single_quotes_linter()
, "spaces_inside" = lintr::spaces_inside_linter()
, "spaces_left_parens" = lintr::spaces_left_parentheses_linter()
, "sprintf" = lintr::sprintf_linter()
, "todo_comments" = lintr::todo_comment_linter(c("todo", "fixme", "to-do"))
, "trailing_blank" = lintr::trailing_blank_lines_linter()
, "trailing_white" = lintr::trailing_whitespace_linter()
, "true_false" = lintr::T_and_F_symbol_linter()
, "unreachable_code" = lintr::unreachable_code_linter()
, "vector_logic" = lintr::vector_logic_linter()
, "undesirable_function" = lintr::undesirable_function_linter(
fun = c(
"cat" = "CRAN forbids the use of cat() in packages except in special cases. Use message() or warning()."
Expand Down

0 comments on commit aaac829

Please sign in to comment.