linters: all_linters(
    backport_linter("3.6.0", except = c("R_user_dir", "deparse1", "...names")),
    line_length_linter(120L),
    object_overwrite_linter(allow_names = c("line", "lines", "pipe", "symbols")),
    todo_comment_linter(
      except_regex = rex::rex(
        "TODO(",
        # GitHub issue number #1234, possibly from another repo org/repo#5678
        maybe(one_or_more(character_class("a-zA-Z0-9-")), "/", one_or_more(character_class("a-zA-Z0-9._-"))),
        "#", one_or_more(digit),
        ")"
      )
    ),
    undesirable_function_linter(modify_defaults(
      defaults = default_undesirable_functions,
      library = NULL,
      options = NULL,
      message = "use cli::cli_inform()",
      warning = "use cli::cli_warn()",
      stop = "use cli::cli_abort()",
      normalizePath = "use normalize_path()"
    )),
    undesirable_operator_linter(modify_defaults(
      defaults = default_undesirable_operators,
      `:::` = NULL,
      `<<-` = NULL
    )),
    unnecessary_concatenation_linter(allow_single_expression = FALSE),
    absolute_path_linter = NULL,
    library_call_linter = NULL,
    nonportable_path_linter = NULL,
    # We now require R>=4.0.0
    strings_as_factors_linter = NULL,
    todo_comment_linter = NULL,
    # TODO(#2327): Enable this.
    unreachable_code_linter = NULL
  )
exclusions: list(
    "inst/doc/creating_linters.R" = 1,
    "inst/example/bad.R",
    "tests/testthat.R" = list(unused_import_linter = Inf),
    "tests/testthat/default_linter_testcode.R",
    "tests/testthat/dummy_packages",
    "tests/testthat/dummy_projects",
    "tests/testthat/exclusions-test",
    "tests/testthat/knitr_extended_formats",
    "tests/testthat/knitr_formats",
    "tests/testthat/knitr_malformed"
  )
