Repository navigation
fix: honor lintr settings for pathless documents - #782
Merged
renkun-ken merged 1 commit intoOct 3, 2026
Merged
renkun-ken merged 1 commit into
renkun-ken merged 1 commit into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation is focused, compatible with supported lintr versions, and comprehensively tested.
Review effort: Balanced
Findings: None
What changed in this PR
Updates pathless document diagnostics to honor project and user lintr configuration while preserving existing literate-document behavior.
Changes:
- Generalizes inline-text linting with safe lintr settings restoration.
- Disables disk caching for pathless documents.
- Adds regression coverage for configuration reloads, options, errors, and filename-sensitive linters.
| File | Description |
|---|---|
R/diagnostics.R |
Loads working-directory settings for pathless documents. |
tests/testthat/test-diagnostics-configuration.R |
Tests pathless configuration behavior and restoration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pathless documents currently force
linters_with_defaults(), so configured rules are ignored: an Interactive cell or untitled buffer reportsline_length_linterandcommented_code_lintereven when the user's.lintrexcludes them.Load lintr settings from the working directory before linting inline R text, reusing the existing helper for literate documents. This preserves project, home, custom-config and option resolution with lintr 3.0 as well as current versions. Restore lintr settings after success or errors, retain real source filenames for literate exclusions, and disable the disk cache for pathless documents.
The R >= 3.4.0 and lintr >= 3.0.0 requirements remain unchanged. This fixes settings in languageserver rather than patching its namespace from vscode-R. Related: REditorSupport/vscode-R#1805.
Validation:
.lintrand an end-to-end VS Code comparison of source documents, cells and inputs, including configuration edits. The comparison fails with released languageserver and passes with this patch plus the input session-context correction in vscode-R.