From f7515739acc0a7b5c580bf05aac6055181739c65 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 13 Feb 2023 23:36:37 -0500 Subject: [PATCH] Improve consistency of some rule docs (#2887) --- clippy.toml | 1 + crates/ruff/src/rules/flake8_no_pep420/rules.rs | 1 - .../src/rules/flake8_pyi/rules/unrecognized_platform.rs | 4 ++-- crates/ruff/src/rules/flake8_quotes/rules.rs | 3 --- .../ruff/src/rules/flake8_tidy_imports/relative_imports.rs | 1 - crates/ruff/src/rules/mccabe/rules.rs | 1 - crates/ruff/src/rules/pandas_vet/rules/inplace_argument.rs | 2 +- crates/ruff/src/rules/pycodestyle/rules/bare_except.rs | 6 +++--- crates/ruff/src/rules/pyflakes/rules/unused_variable.rs | 1 - crates/ruff/src/rules/pylint/rules/yield_in_init.rs | 2 +- 10 files changed, 8 insertions(+), 14 deletions(-) create mode 100644 clippy.toml diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 0000000000000..6f74513ca1aaa --- /dev/null +++ b/clippy.toml @@ -0,0 +1 @@ +doc-valid-idents = ["StackOverflow", "CodeQL", ".."] diff --git a/crates/ruff/src/rules/flake8_no_pep420/rules.rs b/crates/ruff/src/rules/flake8_no_pep420/rules.rs index 9cf2dedf039c1..41d3a657c079e 100644 --- a/crates/ruff/src/rules/flake8_no_pep420/rules.rs +++ b/crates/ruff/src/rules/flake8_no_pep420/rules.rs @@ -25,7 +25,6 @@ define_violation!( /// the absence of the `__init__.py` file is probably an oversight. /// /// ## Options - /// /// * `namespace-packages` pub struct ImplicitNamespacePackage { pub filename: String, diff --git a/crates/ruff/src/rules/flake8_pyi/rules/unrecognized_platform.rs b/crates/ruff/src/rules/flake8_pyi/rules/unrecognized_platform.rs index 8cc59887b044a..e2068ec8f8152 100644 --- a/crates/ruff/src/rules/flake8_pyi/rules/unrecognized_platform.rs +++ b/crates/ruff/src/rules/flake8_pyi/rules/unrecognized_platform.rs @@ -36,7 +36,7 @@ define_violation!( /// ``` /// /// ## References - /// - [PEP 484](https://peps.python.org/pep-0484/#version-and-platform-checking) + /// * [PEP 484](https://peps.python.org/pep-0484/#version-and-platform-checking) pub struct UnrecognizedPlatformCheck; ); impl Violation for UnrecognizedPlatformCheck { @@ -72,7 +72,7 @@ define_violation!( /// ``` /// /// ## References - /// - [PEP 484](https://peps.python.org/pep-0484/#version-and-platform-checking) + /// * [PEP 484](https://peps.python.org/pep-0484/#version-and-platform-checking) pub struct UnrecognizedPlatformName { pub platform: String, } diff --git a/crates/ruff/src/rules/flake8_quotes/rules.rs b/crates/ruff/src/rules/flake8_quotes/rules.rs index 0b3683490b549..6c186ce060845 100644 --- a/crates/ruff/src/rules/flake8_quotes/rules.rs +++ b/crates/ruff/src/rules/flake8_quotes/rules.rs @@ -21,7 +21,6 @@ define_violation!( /// strings, but be consistent. /// /// ## Options - /// /// * `flake8-quotes.inline-quotes` /// /// ## Example @@ -67,7 +66,6 @@ define_violation!( /// strings, but be consistent. /// /// ## Options - /// /// * `flake8-quotes.multiline-quotes` /// /// ## Example @@ -116,7 +114,6 @@ define_violation!( /// strings, but be consistent. /// /// ## Options - /// /// * `flake8-quotes.docstring-quotes` /// /// ## Example diff --git a/crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs b/crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs index e281a7adcf35f..4071d76598ef5 100644 --- a/crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs +++ b/crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs @@ -49,7 +49,6 @@ define_violation!( /// > ``` /// /// ## Options - /// /// * `flake8-tidy-imports.ban-relative-imports` /// /// ## Example diff --git a/crates/ruff/src/rules/mccabe/rules.rs b/crates/ruff/src/rules/mccabe/rules.rs index 2aaea655a3630..c5b0022c97e2e 100644 --- a/crates/ruff/src/rules/mccabe/rules.rs +++ b/crates/ruff/src/rules/mccabe/rules.rs @@ -19,7 +19,6 @@ define_violation!( /// Functions with a high complexity are hard to understand and maintain. /// /// ## Options - /// /// * `mccabe.max-complexity` /// /// ## Example diff --git a/crates/ruff/src/rules/pandas_vet/rules/inplace_argument.rs b/crates/ruff/src/rules/pandas_vet/rules/inplace_argument.rs index 4336ec8e9c33f..3a3a3c6391d4f 100644 --- a/crates/ruff/src/rules/pandas_vet/rules/inplace_argument.rs +++ b/crates/ruff/src/rules/pandas_vet/rules/inplace_argument.rs @@ -31,7 +31,7 @@ define_violation!( /// ``` /// /// ## References - /// - [Why You Should Probably Never Use pandas inplace=True](https://towardsdatascience.com/why-you-should-probably-never-use-pandas-inplace-true-9f9f211849e4) + /// * [_Why You Should Probably Never Use pandas inplace=True_](https://towardsdatascience.com/why-you-should-probably-never-use-pandas-inplace-true-9f9f211849e4) pub struct UseOfInplaceArgument; ); impl AlwaysAutofixableViolation for UseOfInplaceArgument { diff --git a/crates/ruff/src/rules/pycodestyle/rules/bare_except.rs b/crates/ruff/src/rules/pycodestyle/rules/bare_except.rs index cfcc59d9b4738..9e7a87993e336 100644 --- a/crates/ruff/src/rules/pycodestyle/rules/bare_except.rs +++ b/crates/ruff/src/rules/pycodestyle/rules/bare_except.rs @@ -33,9 +33,9 @@ define_violation!( /// ``` /// /// ## References - /// - [PEP 8](https://www.python.org/dev/peps/pep-0008/#programming-recommendations) - /// - [Python: "Exception hierarchy"](https://docs.python.org/3/library/exceptions.html#exception-hierarchy) - /// - [Google Python Style Guide: "Exceptions"](https://google.github.io/styleguide/pyguide.html#24-exceptions) + /// * [PEP 8](https://www.python.org/dev/peps/pep-0008/#programming-recommendations) + /// * [Python: "Exception hierarchy"](https://docs.python.org/3/library/exceptions.html#exception-hierarchy) + /// * [Google Python Style Guide: "Exceptions"](https://google.github.io/styleguide/pyguide.html#24-exceptions) pub struct BareExcept; ); impl Violation for BareExcept { diff --git a/crates/ruff/src/rules/pyflakes/rules/unused_variable.rs b/crates/ruff/src/rules/pyflakes/rules/unused_variable.rs index 6c97c71a8d6cf..e370e5f30e0b8 100644 --- a/crates/ruff/src/rules/pyflakes/rules/unused_variable.rs +++ b/crates/ruff/src/rules/pyflakes/rules/unused_variable.rs @@ -28,7 +28,6 @@ define_violation!( /// [`dummy-variable-rgx`] pattern. /// /// ## Options - /// /// * `dummy-variable-rgx` /// /// ## Example diff --git a/crates/ruff/src/rules/pylint/rules/yield_in_init.rs b/crates/ruff/src/rules/pylint/rules/yield_in_init.rs index 452497baea8e3..be02f804b3641 100644 --- a/crates/ruff/src/rules/pylint/rules/yield_in_init.rs +++ b/crates/ruff/src/rules/pylint/rules/yield_in_init.rs @@ -32,7 +32,7 @@ define_violation!( /// ``` /// /// ## References - /// * [`py-init-method-is-generator`](https://codeql.github.com/codeql-query-help/python/py-init-method-is-generator/) + /// * [CodeQL: `py-init-method-is-generator`](https://codeql.github.com/codeql-query-help/python/py-init-method-is-generator/) pub struct YieldInInit; );