ruff/crates
Micha Reiser b34278e0cd
Introduce LinterSettings
## Stack Summary

This stack splits `Settings` into `FormatterSettings` and `LinterSettings` and moves it into `ruff_workspace`. This change is necessary to add the `FormatterSettings` to `Settings` without adding `ruff_python_formatter` as a dependency to `ruff_linter` (and the linter should not contain the formatter settings). 

A quick overview of our settings struct at play:

* `Options`: 1:1 representation of the options in the `pyproject.toml` or `ruff.toml`.  Used for deserialization.
* `Configuration`: Resolved `Options`, potentially merged from multiple configurations (when using `extend`). The representation is very close if not identical to the `Options`.
* `Settings`: The resolved configuration that uses a data format optimized for reading. Optional fields are initialized with their default values. Initialized by `Configuration::into_settings` .

The goal of this stack is to split `Settings` into tool-specific resolved `Settings` that are independent of each other. This comes at the advantage that the individual crates don't need to know anything about the other tools. The downside is that information gets duplicated between `Settings`. Right now the duplication is minimal (`line-length`, `tab-width`) but we may need to come up with a solution if more expensive data needs sharing.

This stack focuses on `Settings`. Splitting `Configuration` into some smaller structs is something I'll follow up on later. 

## PR Summary

This PR extracts the linter-specific settings into a new `LinterSettings` struct and adds it as a `linter` field to the `Settings` struct. This is in preparation for moving `Settings` from `ruff_linter` to `ruff_workspace`

## Test Plan

`cargo test`
2023-09-20 17:02:34 +02:00
..
flake8_to_ruff Rename ruff crate to ruff_linter (#7529) 2023-09-20 08:38:27 +02:00
ruff_benchmark Introduce LinterSettings 2023-09-20 17:02:34 +02:00
ruff_cache Unify Settings and AllSettings (#7532) 2023-09-20 13:56:07 +00:00
ruff_cli Introduce LinterSettings 2023-09-20 17:02:34 +02:00
ruff_dev Introduce LinterSettings 2023-09-20 17:02:34 +02:00
ruff_diagnostics Create ruff_notebook crate (#7039) 2023-09-01 13:56:44 +00:00
ruff_formatter Allow parenthesized content exceed configured line width (#7490) 2023-09-20 08:39:25 +02:00
ruff_index Add unreachable code rule (#5384) 2023-07-04 14:27:23 +00:00
ruff_linter Introduce LinterSettings 2023-09-20 17:02:34 +02:00
ruff_macros Unify Settings and AllSettings (#7532) 2023-09-20 13:56:07 +00:00
ruff_notebook chore: Upgrade pyproject-toml crate (#7335) 2023-09-13 17:55:03 +02:00
ruff_python_ast Use CommentRanges in backwards lexing (#7360) 2023-09-16 03:21:45 +00:00
ruff_python_codegen Fix stylist indentation with a formfeed (#7489) 2023-09-19 12:01:16 +02:00
ruff_python_formatter Allow parenthesized content exceed configured line width (#7490) 2023-09-20 08:39:25 +02:00
ruff_python_index Remove triple-quoted string ranges computation (#7476) 2023-09-18 20:57:49 +05:30
ruff_python_literal Avoid parsing other parts of a format specification if replacements are present (#6858) 2023-08-25 17:42:57 +00:00
ruff_python_parser Add range to lexer test snapshots (#7265) 2023-09-11 19:12:46 +00:00
ruff_python_resolver Replace .map_or(false, $closure) with .is_some_and(closure) (#6244) 2023-08-01 19:29:42 +02:00
ruff_python_semantic [refurb] Implement unnecessary-enumerate (FURB148) (#7454) 2023-09-19 20:19:28 +00:00
ruff_python_stdlib [flake8-logging] Implement LOG002: invalid-get-logger-argument (#7399) 2023-09-16 12:21:30 -04:00
ruff_python_trivia Tokenizer: Emit only a single bogus token (#7425) 2023-09-19 16:06:03 +02:00
ruff_shrinking Bump shlex from 1.1.0 to 1.2.0 (#7381) 2023-09-14 09:40:05 -05:00
ruff_source_file Use dot references in docs for methods (#7391) 2023-09-14 14:35:34 -04:00
ruff_text_size Unify line size settings between ruff and the formatter (#6873) 2023-08-28 06:44:56 +00:00
ruff_wasm Introduce LinterSettings 2023-09-20 17:02:34 +02:00
ruff_workspace Introduce LinterSettings 2023-09-20 17:02:34 +02:00