Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to turn off diagnostics for ipynb #1179

Closed
franknarf1 opened this issue Aug 17, 2022 · 3 comments
Closed

Option to turn off diagnostics for ipynb #1179

franknarf1 opened this issue Aug 17, 2022 · 3 comments

Comments

@franknarf1
Copy link

Is your feature request related to a problem? Please describe.
In VS Code, with the R and Jupyter extensions, ipynb files with lintr issues get flagged with the unhelpful message:

Failed to run diagnostics: ! error in callr subprocess
Caused by error:
! Full file exclusions must be character vectors of length 1. items: 1 are not! lintr

For example, my cell

options(width=120)

received this message, but it went away after I added spaces around the =.

Because the wrong message is sent, I cannot debug lintr issues in notebooks. You can see someone with the same problem here in a deleted SO post (need high rep to view):

Encountered the same issue. I haven't solved it yet, but I noticed that for me, the red underline only shows up if there is a linting issue in the block of code

Describe the solution you'd like
Can there be a setting to disable diagnostics for ipynb files? Eg

"r.lsp.diagnostics_exclude_extensions": "ipynb"

Alternately, maybe this could simply be default behavior for the R VS Code extension?

Describe alternatives you've considered
Maybe this is already supported via .lintr exclusions (?), but I haven't found out how from the docs and trial-and-error.

My current workaround is to disable lintr entirely as suggested here #343 (comment) (with VS Code setting "r.lsp.diagnostics": false), but I would like to use lintr for R scripts.

Because Jupyter notebooks are not yet supported r-lib/lintr#383 or #378 I don't expect a direct fix to this problem such that lintr would work for my notebooks. Even if notebooks were supported, I would probably still want to keep linting only for my "real" code in R scripts, so I can be undistracted by lintr messages when using a notebook like an enhanced R terminal.

Additional context
I have not used lintr for long (having started thanks to switching to VS Code recently), but it looks like it can be very helpful!

Copy link

This issue is stale because it has been open for 365 days with no activity.

@github-actions github-actions bot added the stale label Mar 22, 2024
Copy link

github-actions bot commented Apr 5, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as completed Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
@franknarf1 and others