Promote lint. settings over top-level settings#9476
Promote lint. settings over top-level settings#9476MichaReiser merged 3 commits intorelease/0.2.0from
lint. settings over top-level settings#9476Conversation
372b4d1 to
37df312
Compare
CodSpeed Performance ReportMerging #9476 will not alter performanceFalling back to comparing Summary
|
| - [`force-single-line`](settings.md#lint_isort_force-single-line) | ||
| - [`force-wrap-aliases`](settings.md#lint_isort_force-wrap-aliases) | ||
| - [`lines-after-imports`](settings.md#lint_isort_lines-after-imports) | ||
| - [`lines-between-types`](settings.md#lint_isort_lines-between-types) | ||
| - [`split-on-trailing-comma`](settings.md#lint_isort_split-on-trailing-comma) |
There was a problem hiding this comment.
An example where we don't use full qualified setting names.
37df312 to
d9d44d8
Compare
|
d9d44d8 to
c9dbc2d
Compare
| The set of enabled rules is controlled via the [`select`](settings.md#select), | ||
| [`extend-select`](settings.md#extend-select), and [`ignore`](settings.md#ignore) settings. | ||
| The set of enabled rules is controlled via the [`lint.select`](settings.md#lint_select), | ||
| [`lint.extend-select`](settings.md#lint_extend-select), and [`lint.ignore`](settings.md#lint_ignore) settings. |
There was a problem hiding this comment.
All the changes in here look reasonable to me.
| /// | ||
| /// ## Options | ||
| /// - `flake8-bugbear.extend-immutable-calls` | ||
| /// - `lint.flake8-bugbear.extend-immutable-calls` |
There was a problem hiding this comment.
Did you verify manually that these still work, when rendered in the rule documentation?
There was a problem hiding this comment.
I verified some of them ;)
| .into_iter() | ||
| .chain(parents.iter().filter_map(|parent| parent.name())) | ||
| .chain(scope) | ||
| .join("."); |
There was a problem hiding this comment.
This all got so much simpler, where did the simplification come from?
There was a problem hiding this comment.
By writing simpler code 😆
I realised that the only difference between the two is whether we add the tool.ruff prefix or not. The fact that parents is now an iter made it more obvious to me that we could use iter.join over manually constructing the string.
charliermarsh
left a comment
There was a problem hiding this comment.
The changes you made (to the docs, etc.) generally look good to me. It's a shame that existing anchor links won't work any more, but it seems really hard to avoid. Thanks for cleaning this up.
We could add backwards-compatible anchors. We could add backwards compatible ids if we want to keep anchor links from external websites working (I hope I managed to update all internal references). |
c9dbc2d to
827f3a5
Compare
827f3a5 to
b506995
Compare
Summary
This PR marks the top-level lint settings as deprecated (schema only) and updates the website to document the options under the lint section (removes the top-level settings).
I had to make changes to the documentation generation to now support 3-level deep options
lint.pydocstyleinstead ofpydocstyle) because sub-sub-sections are rendered at the same level as sub-sections.lint.pycodestyle.xxxinstead ofpycodestyle.xxx._instead of-as a separator to disambiguate between the subsectionlint.pydocstyleand optionlint-pydocstyleI feel undecided about one open question: Should we use the full setting name in READMEs or only the name? For example. Should we write
lint.ignoreorignore? Or a more extreme example. Should we write max-complexityorlint.mccabe.max-complexity`. We currently use a mix of both:lintprefix)I changed the tutorial to use long names in most positions but it didn't always feel right.
Considerations
One downside of removing the top-level settings from the website is that Ruff's documentation isn't versioned. Users using an older version of ruff that only supports the global settings or use the global options might be confused why the options are missing.
A possible solution is adding aliasing support to our documentation generation, although that might be tricky.
IMO, removing is fine because the
lintsection has been supported since v0.0.292, which feels like a very long time ago.Next steps
Emit deprecation messages when a configuration uses any deprecated top-level settings.
Test Plan
lintsection (which helps discoverability).