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

Remove --preview as a required argument for ruff server #12053

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

snowsignal
Copy link
Contributor

Summary

ruff server has reached a point of stabilization, and --preview is no longer required as a flag.

--preview is still supported as a flag, since future features may be need to gated behind it initially.

Test Plan

A simple way to test this is to run ruff server from the command line. No error about a missing --preview argument should be reported.

@snowsignal snowsignal added the server Related to the LSP server label Jun 26, 2024
@snowsignal snowsignal added this to the Ruff Server: Stable milestone Jun 26, 2024
@snowsignal snowsignal force-pushed the jane/server/remove-preview-requirement branch from b2254b0 to 62aa56f Compare June 26, 2024 18:46
Copy link
Contributor

github-actions bot commented Jun 26, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check encountered linter errors. (no lint changes; 1 project error)

demisto/content (error)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `pyproject.toml`:
  - 'ignore' -> 'lint.ignore'
  - 'select' -> 'lint.select'
  - 'unfixable' -> 'lint.unfixable'
  - 'per-file-ignores' -> 'lint.per-file-ignores'
warning: `PGH001` has been remapped to `S307`.
warning: `PGH002` has been remapped to `G010`.
warning: `PLR1701` has been remapped to `SIM101`.
ruff failed
  Cause: Selection of deprecated rule `E999` is not allowed when preview is enabled.

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

I'm okay merging this but there are at least two follow-ups that are necessary

  • Don't set the --preview flag in ruff-vscode if the server version is >= 0.5. We should do this pre-release to avoid that users will unintentionally opt in the future.
  • I would expect that ruff server --preview works the same as ruff check --preview and ruff format --preview and enables all --preview features (linter and formatter).

I would expect that running ruff server --preview would enable all preview features similar to setting preview = true in the settings.

Base automatically changed from ruff-0.5 to main June 27, 2024 11:44
An error occurred while trying to automatically change base from ruff-0.5 to main June 27, 2024 11:44
@snowsignal snowsignal force-pushed the jane/server/remove-preview-requirement branch from 62aa56f to 5d5392f Compare June 27, 2024 19:23
@snowsignal
Copy link
Contributor Author

@MichaReiser Thanks for the review! I'll look into addressing the points you brought up.

I would expect that running ruff server --preview would enable all preview features similar to setting preview = true in the settings.

We also have server settings, lint.preview, and format.preview, that control this behavior. We should make it clear that this would override those settings.

@snowsignal snowsignal enabled auto-merge (squash) June 27, 2024 19:26
@snowsignal snowsignal merged commit b28dc9a into main Jun 27, 2024
17 checks passed
@snowsignal snowsignal deleted the jane/server/remove-preview-requirement branch June 27, 2024 19:27
dhruvmanila added a commit that referenced this pull request Jul 5, 2024
@dhruvmanila dhruvmanila added the internal An internal refactor or improvement label Jul 5, 2024
dhruvmanila added a commit that referenced this pull request Jul 5, 2024
…12053)" (#12196)

This reverts commit b28dc9a.

We're not ready to stabilize the server yet. There's some pending work
for the VS Code extension and documentation improvements.

This change is to unblock Ruff release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement server Related to the LSP server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants