mirror of https://github.com/astral-sh/ruff
refactor: Move fix symbol legend into ruff_dev
This commit is contained in:
parent
180541a924
commit
a2277cfeba
|
|
@ -717,11 +717,11 @@ By default, Ruff enables Flake8's `E` and `F` rules. Ruff supports all rules fro
|
||||||
and a [subset](#error-e) of the `E` category, omitting those stylistic rules made obsolete by the
|
and a [subset](#error-e) of the `E` category, omitting those stylistic rules made obsolete by the
|
||||||
use of an autoformatter, like [Black](https://github.com/psf/black).
|
use of an autoformatter, like [Black](https://github.com/psf/black).
|
||||||
|
|
||||||
The 🛠 emoji indicates that a rule is automatically fixable by the `--fix` command-line option.
|
|
||||||
|
|
||||||
<!-- Sections automatically generated by `cargo dev generate-rules-table`. -->
|
<!-- Sections automatically generated by `cargo dev generate-rules-table`. -->
|
||||||
<!-- Begin auto-generated sections. -->
|
<!-- Begin auto-generated sections. -->
|
||||||
|
|
||||||
|
The 🛠 emoji indicates that a rule is automatically fixable by the `--fix` command-line option.
|
||||||
|
|
||||||
### Pyflakes (F)
|
### Pyflakes (F)
|
||||||
|
|
||||||
For more, see [Pyflakes](https://pypi.org/project/pyflakes/) on PyPI.
|
For more, see [Pyflakes](https://pypi.org/project/pyflakes/) on PyPI.
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ const TABLE_END_PRAGMA: &str = "<!-- End auto-generated sections. -->";
|
||||||
const TOC_BEGIN_PRAGMA: &str = "<!-- Begin auto-generated table of contents. -->";
|
const TOC_BEGIN_PRAGMA: &str = "<!-- Begin auto-generated table of contents. -->";
|
||||||
const TOC_END_PRAGMA: &str = "<!-- End auto-generated table of contents. -->";
|
const TOC_END_PRAGMA: &str = "<!-- End auto-generated table of contents. -->";
|
||||||
|
|
||||||
|
const FIX_SYMBOL: &str = "🛠";
|
||||||
const URL_PREFIX: &str = "https://beta.ruff.rs/docs/rules";
|
const URL_PREFIX: &str = "https://beta.ruff.rs/docs/rules";
|
||||||
|
|
||||||
#[derive(clap::Args)]
|
#[derive(clap::Args)]
|
||||||
|
|
@ -31,7 +32,7 @@ fn generate_table(table_out: &mut String, rules: impl IntoIterator<Item = Rule>,
|
||||||
for rule in rules {
|
for rule in rules {
|
||||||
let fix_token = match rule.autofixable() {
|
let fix_token = match rule.autofixable() {
|
||||||
None => "",
|
None => "",
|
||||||
Some(_) => "🛠",
|
Some(_) => FIX_SYMBOL,
|
||||||
};
|
};
|
||||||
|
|
||||||
let rule_name = rule.as_ref();
|
let rule_name = rule.as_ref();
|
||||||
|
|
@ -55,7 +56,7 @@ fn generate_table(table_out: &mut String, rules: impl IntoIterator<Item = Rule>,
|
||||||
|
|
||||||
pub fn main(args: &Args) -> Result<()> {
|
pub fn main(args: &Args) -> Result<()> {
|
||||||
// Generate the table string.
|
// Generate the table string.
|
||||||
let mut table_out = String::new();
|
let mut table_out = format!("The {FIX_SYMBOL} emoji indicates that a rule is automatically fixable by the `--fix` command-line option.\n\n");
|
||||||
let mut toc_out = String::new();
|
let mut toc_out = String::new();
|
||||||
for linter in Linter::iter() {
|
for linter in Linter::iter() {
|
||||||
let codes_csv: String = match linter.common_prefix() {
|
let codes_csv: String = match linter.common_prefix() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue