ruff/crates/ruff_macros/src
Zanie Blue 6566d00295
Update rule selection to respect preview mode (#7195)
## Summary

<!-- What's the purpose of the change? What does it do, and why? -->

Extends work in #7046 (some relevant discussion there)

Changes:

- All nursery rules are now referred to as preview rules
- Documentation for the nursery is updated to describe preview
- Adds a "PREVIEW" selector for preview rules
- This is primarily to allow `--preview --ignore PREVIEW --extend-select
FOO001,BAR200`
- Using `--preview` enables preview rules that match selectors

Notable decisions:

- Preview rules are not selectable by their rule code without enabling
preview
- Retains the "NURSERY" selector for backwards compatibility
- Nursery rules are selectable by their rule code for backwards
compatiblity

Additional work:

- Selection of preview rules without the "--preview" flag should display
a warning
- Use of deprecated nursery selection behavior should display a warning
- Nursery selection should be removed after some time

## Test Plan

<!-- How was it tested? -->

Manual confirmation (i.e. we don't have an preview rules yet just
nursery rules so I added a preview rule for manual testing)

New unit tests

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2023-09-11 12:28:39 -05:00
..
cache_key.rs Disallow unreachable_pub (#4314) 2023-05-11 18:00:00 -04:00
combine_options.rs Move Configuration to ruff_workspace crate (#6920) 2023-08-28 06:21:35 +00:00
config.rs Move Configuration to ruff_workspace crate (#6920) 2023-08-28 06:21:35 +00:00
derive_message_formats.rs Format let-else with rustfmt nightly (#5461) 2023-07-03 02:13:35 +00:00
lib.rs Merge registry into codes (#4651) 2023-06-02 10:33:01 +00:00
map_codes.rs Update rule selection to respect preview mode (#7195) 2023-09-11 12:28:39 -05:00
newtype_index.rs Add unreachable code rule (#5384) 2023-07-04 14:27:23 +00:00
rule_code_prefix.rs Update rule selection to respect preview mode (#7195) 2023-09-11 12:28:39 -05:00
rule_namespace.rs Fix remaining Copyright rule references (#5577) 2023-07-07 02:49:19 +00:00
violation.rs Disallow unreachable_pub (#4314) 2023-05-11 18:00:00 -04:00