Skip to content

Adding examples to documentation of each linter #1492

Description

@IndrajeetPatil

I think docs for each linter should have an examples section with at least one example of code that does produce lint and another that doesn't.

I think the style guide is good to provide the underlying rationale for the lint (provided that the reader actually clicks on that link!), but it doesn't lead to much exploration on the reader's part. Giving concrete examples means that the reader can just copy-paste examples and start toying around with them to see what does and doesn't lint.

Note to self: Make sure all of them follow the style guide, and so use " instead of ', e.g.

Progress tracker

  • absolute_path_linter
  • any_duplicated_linter
  • any_is_na_linter
  • assignment_linter
  • backport_linter
  • boolean_arithmetic_linter
  • brace_linter
  • class_equals_linter
  • commas_linter
  • commented_code_linter
  • condition_message_linter
  • conjunct_test_linter
  • consecutive_stopifnot_linter
  • cyclocomp_linter
  • duplicate_argument_linter
  • equals_na_linter
  • expect_comparison_linter
  • expect_identical_linter
  • expect_length_linter
  • expect_named_linter
  • expect_not_linter
  • expect_null_linter
  • expect_s3_class_linter
  • expect_s4_class_linter
  • expect_true_false_linter
  • expect_type_linter
  • extraction_operator_linter
  • fixed_regex_linter
  • function_argument_linter
  • function_left_parentheses_linter
  • function_return_linter
  • ifelse_censor_linter
  • implicit_integer_linter
  • infix_spaces_linter
  • inner_combine_linter
  • lengths_linter
  • line_length_linter
  • literal_coercion_linter
  • missing_argument_linter
  • missing_package_linter
  • namespace_linter
  • nested_ifelse_linter
  • no_tab_linter
  • nonportable_path_linter
  • numeric_leading_zero_linter
  • object_length_linter
  • object_name_linter
  • object_usage_linter
  • outer_negation_linter
  • package_hooks_linter
  • paren_body_linter
  • paste_linter
  • pipe_call_linter
  • pipe_continuation_linter
  • redundant_equals_linter
  • redundant_ifelse_linter
  • regex_subset_linter
  • semicolon_linter
  • seq_linter
  • single_quotes_linter
  • spaces_inside_linter
  • spaces_left_parentheses_linter
  • sprintf_linter
  • string_boundary_linter
  • strings_as_factors_linter
  • system_file_linter
  • T_and_F_symbol_linter
  • todo_comment_linter
  • trailing_blank_lines_linter
  • trailing_whitespace_linter
  • undesirable_function_linter
  • undesirable_operator_linter
  • unnecessary_lambda_linter
  • unneeded_concatenation_linter
  • unreachable_code_linter
  • unused_import_linter
  • vector_logic_linter
  • yoda_test_linter

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions