Skip to content

Support with_defaults(default = NULL), with warning #1361

Closed
@MichaelChirico

Description

@MichaelChirico

One last new error discovered by #1304 -- usage like that here:

https://github.com/rexyai/RestRserve/blob/852785a6bfa1c6691de520bd14d1246619436419/.lintr#L1-L11

linters: with_defaults(
  assignment_linter = RestRserve:::assignment_eq_linter,
  infix_spaces_linter,
  commas_linter,
  no_tab_linter,
  spaces_inside_linter,
  spaces_left_parentheses_linter,
  trailing_blank_lines_linter,
  trailing_whitespace_linter,
  line_length_linter(120),
  default = NULL)

results in an error on main:

lintr::lint_package()
Error in modify_defaults(..., defaults = defaults) : 
  `defaults` must be a named list.
In addition: Warning message:
Function with_defaults was deprecated in lintr version 2.0.9001. Use linters_with_defaults instead.

We should soften this to be a deprecation warning instead & support the intended usage (which should be the same as default = list())

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions