Skip to content

Commit

Permalink
Add doc on how to ignore certain violations
Browse files Browse the repository at this point in the history
  • Loading branch information
jsh9 committed Aug 15, 2023
1 parent 170da52 commit 8e0ccce
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down
23 changes: 23 additions & 0 deletions docs/how_to_ignore.md
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 6 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 8e0ccce

Please sign in to comment.