Skip to content

Conversation

@pascal-sauer
Copy link

According to https://github.com/r-lib/lintr/releases with lintr 3.3.0-1:

lint() no longer picks up settings automatically in ad hoc invocations like lint("text\n") or lint(text = "str"). You should set parse_settings=TRUE to force settings to be read. Emacs ESS users may need to update to a recent version, e.g. ESS>20251003.

This means .lintr files are ignored for the linting vscode does in the background by default. Explicitly setting parse_settings = TRUE (as suggested in this PR) helps.


if (file.exists(path)) {
lints <- lintr::lint(path, cache = cache, text = content)
lints <- lintr::lint(path, cache = cache, text = content, parse_settings = TRUE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can omit this diff? the change in {lintr}, IIRC, is about the latter invocation (no path, just text=).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are probably right about this, would need to double check to be sure :)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just had the same problem and had to modify a local copy of languageserver to fix my .linter file not being used (actually I was going to submit a PR myself).

I can confirm this change is necessary even in this case. :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, it makes sense to always be explicit to protect from future lintr changes.

@pascal-sauer
Copy link
Author

I'm unsure how the maintainers (I guess @renkun-ken @randy3k) want to proceed with this PR. Do you want me to bring this PR into a state so it can be merged, and what steps would that entail? Or would you rather implement a fix yourself (totally fine by me!)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants