Skip to content

lintr::lint(text=) no longer reads personal settings #2847

@bastistician

Description

@bastistician

(This doesn't affect a release yet, but is an issue of the recently merged #2805, raised here per request of @MichaelChirico.)

The recent change from #2805 means that ~/.lintr settings are no longer read when linting text input (inline_data), e.g., lintr::lint(<R-code-as-string>), which is what Emacs-ESS uses to lint code in R buffers. So with the current development version of lintr I'd only see notes from the default_linters.

Here is an example where the non-default duplicate_argument_linter() is added in the settings:

library("lintr")
cat("linters: linters_with_defaults(duplicate_argument_linter())\n", file = tf <- tempfile())
options("lintr.linter_file" = tf)
lint(text = "list(x = 1, x = 2)")  # parse_settings is TRUE by default
## i No lints found.

In lintr 3.2.0, this did produce a "lint".

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions