From 8e0cccee875d91f3734923f40b0a6dfbc46965fe Mon Sep 17 00:00:00 2001 From: jsh9 <25124332+jsh9@users.noreply.github.com> Date: Tue, 15 Aug 2023 02:39:18 -0700 Subject: [PATCH] Add doc on how to ignore certain violations --- README.md | 6 ++++++ docs/how_to_ignore.md | 23 +++++++++++++++++++++++ docs/index.md | 6 ++++++ 3 files changed, 35 insertions(+) create mode 100644 docs/how_to_ignore.md diff --git a/README.md b/README.md index 1110353..f4021ce 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ serves complementary purposes. It is recommended that you use both together. - [2.3. As a pre-commit hook](#23-as-a-pre-commit-hook) - [2.4. Native vs _flake8_](#24-native-vs-flake8) - [2.5. How to configure _pydoclint_](#25-how-to-configure-pydoclint) + - [2.6. How to ignore certain violations in _flake8_ mode](#26-how-to-ignore-certain-violations-in-flake8-mode) - [3. Style violation codes](#3-style-violation-codes) - [4. Notes for users](#4-notes-for-users) - [5. Notes for developers](#5-notes-for-developers) @@ -111,6 +112,11 @@ Here's comparison: Please read this page: [How to configure _pydoclint_](https://jsh9.github.io/pydoclint/how_to_config.html) +### 2.6. How to ignore certain violations in _flake8_ mode + +Please read this page: +[How to ignore certain violations](https://jsh9.github.io/pydoclint/how_to_ignore.html) + ## 3. Style violation codes _pydoclint_ currently has 6 categories of style violation codes: diff --git a/docs/how_to_ignore.md b/docs/how_to_ignore.md new file mode 100644 index 0000000..1428842 --- /dev/null +++ b/docs/how_to_ignore.md @@ -0,0 +1,23 @@ +# How to ignore certain violations in *flake8* mode + +In *flake8* mode (meaning that you use *pydoclint* as a flake8 plugin), if you'd like to ignore a specific violation code (such as `DOC201` and `DOC301`) in-line, you can add this comment to the function of your choice: + +```python +def my_function( # noqa: DOC201, DOC301 + arg1, + arg2, +) -> None: + ... +``` + +If you would like to ignore certain categories of violations (such as `DOC2xx`) in-line, you can do this: + +```python +def my_function( # noqa: DOC2 + arg1, + arg2, +) -> None: + ... +``` + +All the usage is consistent with how you would use *flake8*. Please read the official *flake8* documentation for full details: https://flake8.pycqa.org/en/latest/user/violations.html. diff --git a/docs/index.md b/docs/index.md index 1110353..f4021ce 100644 --- a/docs/index.md +++ b/docs/index.md @@ -41,6 +41,7 @@ serves complementary purposes. It is recommended that you use both together. - [2.3. As a pre-commit hook](#23-as-a-pre-commit-hook) - [2.4. Native vs _flake8_](#24-native-vs-flake8) - [2.5. How to configure _pydoclint_](#25-how-to-configure-pydoclint) + - [2.6. How to ignore certain violations in _flake8_ mode](#26-how-to-ignore-certain-violations-in-flake8-mode) - [3. Style violation codes](#3-style-violation-codes) - [4. Notes for users](#4-notes-for-users) - [5. Notes for developers](#5-notes-for-developers) @@ -111,6 +112,11 @@ Here's comparison: Please read this page: [How to configure _pydoclint_](https://jsh9.github.io/pydoclint/how_to_config.html) +### 2.6. How to ignore certain violations in _flake8_ mode + +Please read this page: +[How to ignore certain violations](https://jsh9.github.io/pydoclint/how_to_ignore.html) + ## 3. Style violation codes _pydoclint_ currently has 6 categories of style violation codes: