ruff/crates
Jane Lewis 7504bf347b
--show-settings displays active settings in a far more readable format (#9464)
<!--
Thank you for contributing to Ruff! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

Fixes #8334.

`Display` has been implemented for `ruff_workspace::Settings`, which
gives a much nicer and more readable output to `--show-settings`.

Internally, a `display_settings` utility macro has been implemented to
reduce the boilerplate of the display code.

### Work to be done

- [x] A lot of formatting for `Vec<_>` and `HashSet<_>` types have been
stubbed out, using `Debug` as a fallback. There should be a way to add
generic formatting support for these types as a modifier in
`display_settings`.
- [x] Several complex types were also stubbed out and need proper
`Display` implementations rather than falling back on `Debug`.
- [x] An open question needs to be answered: how important is it that
the output be valid TOML? Some types in settings, such as a hash-map
from a glob pattern to a multi-variant enum, will be hard to rework into
valid _and_ readable TOML.
- [x] Tests need to be implemented.

## Test Plan

Tests consist of a snapshot test for the default `--show-settings`
output and a doctest for `display_settings!`.
2024-01-12 14:30:29 -05:00
..
ruff_benchmark Remove type parameter from parse_* methods (#9466) 2024-01-11 19:41:19 +01:00
ruff_cache Make all dependencies workspace dependencies (#9333) 2024-01-02 13:41:59 +00:00
ruff_cli --show-settings displays active settings in a far more readable format (#9464) 2024-01-12 14:30:29 -05:00
ruff_dev Move pyproject_config into Resolver (#9453) 2024-01-10 17:58:53 -05:00
ruff_diagnostics Enable annotation quoting for multi-line expressions (#9142) 2023-12-15 01:03:09 +00:00
ruff_formatter --show-settings displays active settings in a far more readable format (#9464) 2024-01-12 14:30:29 -05:00
ruff_index Make all dependencies workspace dependencies (#9333) 2024-01-02 13:41:59 +00:00
ruff_linter --show-settings displays active settings in a far more readable format (#9464) 2024-01-12 14:30:29 -05:00
ruff_macros remove several uses of unsafe (#8600) 2023-11-28 09:50:03 -05:00
ruff_notebook Generate deterministic ids when formatting notebooks (#9359) 2024-01-04 09:19:00 -06:00
ruff_python_ast Account for possibly-empty f-string values in truthiness logic (#9484) 2024-01-11 21:16:19 -05:00
ruff_python_codegen Remove source path from parser errors (#9322) 2023-12-30 20:33:05 +00:00
ruff_python_formatter --show-settings displays active settings in a far more readable format (#9464) 2024-01-12 14:30:29 -05:00
ruff_python_index Remove type parameter from parse_* methods (#9466) 2024-01-11 19:41:19 +01:00
ruff_python_literal Use Rust 1.75 toolchain (#9437) 2024-01-08 18:03:16 +01:00
ruff_python_parser Remove type parameter from parse_* methods (#9466) 2024-01-11 19:41:19 +01:00
ruff_python_resolver Use Rust 1.75 toolchain (#9437) 2024-01-08 18:03:16 +01:00
ruff_python_semantic Restrict builtin-attribute-shadowing to actual shadowed references (#9462) 2024-01-11 12:59:40 -05:00
ruff_python_stdlib Treat all typing_extensions members as typing aliases (#9335) 2023-12-31 14:23:33 -04:00
ruff_python_trivia Remove type parameter from parse_* methods (#9466) 2024-01-11 19:41:19 +01:00
ruff_shrinking Bump version to v0.1.13 (#9493) 2024-01-12 09:27:39 -05:00
ruff_source_file Add cell indexes to all diagnostics (#9387) 2024-01-04 14:02:23 +00:00
ruff_text_size Make all dependencies workspace dependencies (#9333) 2024-01-02 13:41:59 +00:00
ruff_wasm Make all dependencies workspace dependencies (#9333) 2024-01-02 13:41:59 +00:00
ruff_workspace --show-settings displays active settings in a far more readable format (#9464) 2024-01-12 14:30:29 -05:00