Skip to content

Conversation

@dhruvmanila
Copy link
Member

Summary

This PR refactors the RuffSettings struct to directly include the resolved Settings instead of including the specific fields from it. The server utilizes a lot of it already, so it makes sense to just include the entire struct for simplicity.

Deref

I implemented Deref on RuffSettings to return the Settings because RuffSettings is now basically a wrapper around it with the config path as the other field. This path field is only used for debugging ("printDebugInformation" command).

@dhruvmanila dhruvmanila added the internal An internal refactor or improvement label Feb 8, 2025
Comment on lines 35 to 39
if is_document_excluded_for_linting(
document_path,
file_resolver_settings,
&settings.file_resolver,
linter_settings,
query.text_document_language_id(),
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm still passing these individually to is_document_excluded_* functions because some paths require a different linter settings (e.g., organize imports uses a specific settings which only selects I).

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@dhruvmanila dhruvmanila merged commit cc0a5dd into main Feb 10, 2025
21 checks passed
@dhruvmanila dhruvmanila deleted the dhruv/ruff-settings branch February 10, 2025 04:50
dcreager added a commit that referenced this pull request Feb 10, 2025
* main: (991 commits)
  [red-knot] Resolve `Options` to `Settings` (#16000)
  Bump version to 0.9.6 (#16074)
  Revert tailwindcss v4 update (#16075)
  Improve migration document (#16072)
  Fix reference definition labels for backtick-quoted shortcut links (#16035)
  RUF009 should behave similar to B008 and ignore attributes with immutable types (#16048)
  [`pylint`] Also report when the object isn't a literal (`PLE1310`) (#15985)
  Update Rust crate rustc-hash to v2.1.1 (#16060)
  Root exclusions in the server to project root (#16043)
  Directly include `Settings` struct for the server (#16042)
  Update Rust crate clap to v4.5.28 (#16059)
  Update Rust crate strum_macros to 0.27.0 (#16065)
  Update NPM Development dependencies (#16067)
  Update Rust crate uuid to v1.13.1 (#16066)
  Update Rust crate strum to 0.27.0 (#16064)
  Update pre-commit dependencies (#16063)
  Update dependency ruff to v0.9.5 (#16062)
  Update Rust crate toml to v0.8.20 (#16061)
  [`flake8-builtins`] Make strict module name comparison optional (`A005`) (#15951)
  [`ruff`] Indented form feeds (`RUF054`) (#16049)
  ...
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants