ruff
6566d002 - Update rule selection to respect preview mode (#7195)

Comment changes are shownComment changes are hidden
Commit
1 year ago
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>
Author
Parents
  • crates
    • flake8_to_ruff/src
      • File
        plugin.rs
    • ruff/src
      • File
        codes.rs
      • File
        rule_selector.rs
      • settings
        • File
          defaults.rs
        • File
          types.rs
    • ruff_benchmark/benches
      • File
        linter.rs
    • ruff_cli/src/commands
      • File
        rule.rs
    • ruff_dev/src
      • File
        generate_docs.rs
      • File
        generate_rules_table.rs
    • ruff_macros/src
      • File
        map_codes.rs
      • File
        rule_code_prefix.rs
    • ruff_workspace/src
      • File
        configuration.rs
      • File
        pyproject.rs
  • docs
    • File
      faq.md
  • File
    ruff.schema.json