A variety of linters are available in lintr. The most popular ones are readily
accessible through default_linters()
.
Within a lint()
function call, the linters in use are initialized with the provided
arguments and fed with the source file (provided by get_source_expressions()
).
A data frame of all available linters can be retrieved using available_linters()
.
Documentation for linters is structured into tags to allow for easier discovery;
see also available_tags()
.
Tags
The following tags exist:
best_practices (63 linters)
common_mistakes (11 linters)
configurable (44 linters)
consistency (32 linters)
correctness (7 linters)
default (25 linters)
deprecated (6 linters)
efficiency (29 linters)
executing (6 linters)
package_development (14 linters)
pkg_testthat (12 linters)
readability (64 linters)
regex (4 linters)
robustness (17 linters)
style (40 linters)
tidy_design (1 linters)
Linters
The following linters exist:
absolute_path_linter
(tags: best_practices, configurable, robustness)any_duplicated_linter
(tags: best_practices, efficiency)any_is_na_linter
(tags: best_practices, efficiency)assignment_linter
(tags: configurable, consistency, default, style)backport_linter
(tags: configurable, package_development, robustness)boolean_arithmetic_linter
(tags: best_practices, efficiency, readability)brace_linter
(tags: configurable, default, readability, style)class_equals_linter
(tags: best_practices, consistency, robustness)commas_linter
(tags: configurable, default, readability, style)commented_code_linter
(tags: best_practices, default, readability, style)comparison_negation_linter
(tags: consistency, readability)condition_call_linter
(tags: best_practices, configurable, style, tidy_design)condition_message_linter
(tags: best_practices, consistency)conjunct_test_linter
(tags: best_practices, configurable, package_development, pkg_testthat, readability)consecutive_assertion_linter
(tags: consistency, readability, style)consecutive_mutate_linter
(tags: configurable, consistency, efficiency, readability)cyclocomp_linter
(tags: best_practices, configurable, readability, style)duplicate_argument_linter
(tags: common_mistakes, configurable, correctness)empty_assignment_linter
(tags: best_practices, readability)equals_na_linter
(tags: common_mistakes, correctness, default, robustness)expect_comparison_linter
(tags: best_practices, package_development, pkg_testthat)expect_identical_linter
(tags: package_development, pkg_testthat)expect_length_linter
(tags: best_practices, package_development, pkg_testthat, readability)expect_named_linter
(tags: best_practices, package_development, pkg_testthat, readability)expect_not_linter
(tags: best_practices, package_development, pkg_testthat, readability)expect_null_linter
(tags: best_practices, package_development, pkg_testthat)expect_s3_class_linter
(tags: best_practices, package_development, pkg_testthat)expect_s4_class_linter
(tags: best_practices, package_development, pkg_testthat)expect_true_false_linter
(tags: best_practices, package_development, pkg_testthat, readability)expect_type_linter
(tags: best_practices, package_development, pkg_testthat)fixed_regex_linter
(tags: best_practices, configurable, efficiency, readability, regex)for_loop_index_linter
(tags: best_practices, readability, robustness)function_argument_linter
(tags: best_practices, consistency, style)function_left_parentheses_linter
(tags: default, readability, style)function_return_linter
(tags: best_practices, readability)if_not_else_linter
(tags: configurable, consistency, readability)if_switch_linter
(tags: best_practices, configurable, consistency, efficiency, readability)ifelse_censor_linter
(tags: best_practices, efficiency)implicit_assignment_linter
(tags: best_practices, configurable, readability, style)implicit_integer_linter
(tags: best_practices, configurable, consistency, style)indentation_linter
(tags: configurable, default, readability, style)infix_spaces_linter
(tags: configurable, default, readability, style)inner_combine_linter
(tags: consistency, efficiency, readability)is_numeric_linter
(tags: best_practices, consistency, readability)keyword_quote_linter
(tags: consistency, readability, style)length_levels_linter
(tags: best_practices, consistency, readability)length_test_linter
(tags: common_mistakes, efficiency)lengths_linter
(tags: best_practices, efficiency, readability)library_call_linter
(tags: best_practices, configurable, readability, style)line_length_linter
(tags: configurable, default, readability, style)list_comparison_linter
(tags: best_practices, common_mistakes)literal_coercion_linter
(tags: best_practices, consistency, efficiency)matrix_apply_linter
(tags: efficiency, readability)missing_argument_linter
(tags: common_mistakes, configurable, correctness)missing_package_linter
(tags: common_mistakes, robustness)namespace_linter
(tags: configurable, correctness, executing, robustness)nested_ifelse_linter
(tags: efficiency, readability)nested_pipe_linter
(tags: configurable, consistency, readability)nonportable_path_linter
(tags: best_practices, configurable, robustness)nrow_subset_linter
(tags: best_practices, consistency, efficiency)numeric_leading_zero_linter
(tags: consistency, readability, style)nzchar_linter
(tags: best_practices, consistency, efficiency)object_length_linter
(tags: configurable, default, executing, readability, style)object_name_linter
(tags: configurable, consistency, default, executing, style)object_overwrite_linter
(tags: best_practices, configurable, executing, readability, robustness)object_usage_linter
(tags: configurable, correctness, default, executing, readability, style)one_call_pipe_linter
(tags: readability, style)outer_negation_linter
(tags: best_practices, efficiency, readability)package_hooks_linter
(tags: correctness, package_development, style)paren_body_linter
(tags: default, readability, style)paste_linter
(tags: best_practices, configurable, consistency)pipe_call_linter
(tags: readability, style)pipe_consistency_linter
(tags: configurable, readability, style)pipe_continuation_linter
(tags: default, readability, style)pipe_return_linter
(tags: best_practices, common_mistakes)print_linter
(tags: best_practices, consistency)quotes_linter
(tags: configurable, consistency, default, readability, style)redundant_equals_linter
(tags: best_practices, common_mistakes, efficiency, readability)redundant_ifelse_linter
(tags: best_practices, configurable, consistency, efficiency)regex_subset_linter
(tags: best_practices, efficiency, regex)rep_len_linter
(tags: best_practices, consistency, readability)repeat_linter
(tags: readability, style)return_linter
(tags: configurable, default, style)routine_registration_linter
(tags: best_practices, efficiency, robustness)sample_int_linter
(tags: efficiency, readability, robustness)scalar_in_linter
(tags: best_practices, configurable, consistency, efficiency, readability)semicolon_linter
(tags: configurable, default, readability, style)seq_linter
(tags: best_practices, consistency, default, efficiency, robustness)sort_linter
(tags: best_practices, efficiency, readability)spaces_inside_linter
(tags: default, readability, style)spaces_left_parentheses_linter
(tags: default, readability, style)sprintf_linter
(tags: common_mistakes, correctness)stopifnot_all_linter
(tags: best_practices, readability)string_boundary_linter
(tags: configurable, efficiency, readability, regex)strings_as_factors_linter
(tags: robustness)system_file_linter
(tags: best_practices, consistency, readability)T_and_F_symbol_linter
(tags: best_practices, consistency, default, readability, robustness, style)terminal_close_linter
(tags: best_practices, robustness)todo_comment_linter
(tags: configurable, style)trailing_blank_lines_linter
(tags: default, style)trailing_whitespace_linter
(tags: configurable, default, style)undesirable_function_linter
(tags: best_practices, configurable, robustness, style)undesirable_operator_linter
(tags: best_practices, configurable, robustness, style)unnecessary_concatenation_linter
(tags: configurable, efficiency, readability, style)unnecessary_lambda_linter
(tags: best_practices, configurable, efficiency, readability)unnecessary_nesting_linter
(tags: best_practices, configurable, consistency, readability)unnecessary_placeholder_linter
(tags: best_practices, readability)unreachable_code_linter
(tags: best_practices, configurable, readability)unused_import_linter
(tags: best_practices, common_mistakes, configurable, executing)vector_logic_linter
(tags: best_practices, common_mistakes, default, efficiency)which_grepl_linter
(tags: consistency, efficiency, readability, regex)whitespace_linter
(tags: consistency, default, style)yoda_test_linter
(tags: best_practices, package_development, pkg_testthat, readability)