Skip to content

Add code action to disable linters#408

Merged
randy3k merged 11 commits intoREditorSupport:masterfrom
renkun-ken:code-action
Jun 24, 2021
Merged

Add code action to disable linters#408
randy3k merged 11 commits intoREditorSupport:masterfrom
renkun-ken:code-action

Conversation

@renkun-ken
Copy link
Member

@renkun-ken renkun-ken commented Apr 2, 2021

This PR enables CodeAction and provides the following code actions:

  • Disable all linters for this line (appends # nolint in the end of the line if a linter complains).
  • Disable some_linter for this line
  • Test cases

There is an open discussion at r-lib/lintr#720 about disabling specific linters. In the future, we could add code action to disable specific linters that produce diagnostics for certain lines. The development version of lintr already supports disabling specific linters:

# nolint: linter_name, linter2_name
# nolint start: linter_name, linter2_name
# nolint end

@renkun-ken
Copy link
Member Author

I'd like to merge this PR to enable code actions to support only "Disable all linters for this line" before how lintr settles down how individual linters could be disabled.

@randy3k
Copy link
Member

randy3k commented Jun 24, 2021

It makes sense to me to merge the PR. It will be great if you could come up with some tests though.

@renkun-ken
Copy link
Member Author

Yes, I'm working on some test cases for this.

@renkun-ken
Copy link
Member Author

Not sure why windows check not passing.

@renkun-ken
Copy link
Member Author

Looks like the windows build does not use the latest pushed version since the log does not contain the diagnostics in diagnostics_callback with 7a27cc0.

@randy3k
Copy link
Member

randy3k commented Jun 24, 2021

Looks like remotes::install_local() was skipped because of the cache. Using force should fix it.


Run Rscript -e "remotes::install_local()"
12
Skipping install of 'languageserver' from a local remote, the SHA1 (0.3.10) has not changed since last install.
13
  Use `force = TRUE` to force installation

@randy3k randy3k merged commit 6c17a9f into REditorSupport:master Jun 24, 2021
@randy3k
Copy link
Member

randy3k commented Jun 24, 2021

LGTM

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.

2 participants