Skip to content

Commit

Permalink
Add DOC6xx explanations to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jsh9 committed Jun 24, 2024
1 parent f43a961 commit 1a270b0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,15 @@ Please read this page:

## 3. Style violation codes

_pydoclint_ currently has 6 categories of style violation codes:
_pydoclint_ currently has 7 categories of style violation codes:

- `DOC0xx`: Docstring parsing issues
- `DOC1xx`: Violations about input arguments
- `DOC2xx`: Violations about return argument(s)
- `DOC3xx`: Violations about class docstring and class constructor
- `DOC4xx`: Violations about "yield" statements
- `DOC5xx`: Violations about "raise" statements
- `DOC6xx`: Violations about class attributes

For detailed explanations of each violation code, please read this page:
[_pydoclint_ style violation codes](https://jsh9.github.io/pydoclint/violation_codes.html).
Expand Down
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,15 @@ Please read this page:

## 3. Style violation codes

_pydoclint_ currently has 6 categories of style violation codes:
_pydoclint_ currently has 7 categories of style violation codes:

- `DOC0xx`: Docstring parsing issues
- `DOC1xx`: Violations about input arguments
- `DOC2xx`: Violations about return argument(s)
- `DOC3xx`: Violations about class docstring and class constructor
- `DOC4xx`: Violations about "yield" statements
- `DOC5xx`: Violations about "raise" statements
- `DOC6xx`: Violations about class attributes

For detailed explanations of each violation code, please read this page:
[_pydoclint_ style violation codes](https://jsh9.github.io/pydoclint/violation_codes.html).
Expand Down
14 changes: 14 additions & 0 deletions docs/violation_codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [3. `DOC3xx`: Violations about class docstring and class constructor](#3-doc3xx-violations-about-class-docstring-and-class-constructor)
- [4. `DOC4xx`: Violations about "yield" statements](#4-doc4xx-violations-about-yield-statements)
- [5. `DOC5xx`: Violations about "raise" statements](#5-doc5xx-violations-about-raise-statements)
- [6. `DOC6xx`: Violations about class attributes](#6-doc6xx-violations-about-class-attributes)

<!--TOC-->

Expand Down Expand Up @@ -86,3 +87,16 @@ have a return section.
| -------- | --------------------------------------------------------------------------------------------------------- |
| `DOC501` | Function/method has "raise" statements, but the docstring does not have a "Raises" section |
| `DOC502` | Function/method has a "Raises" section in the docstring, but there are not "raise" statements in the body |

## 6. `DOC6xx`: Violations about class attributes

| Code | Explanation |
| -------- | --------------------------------------------------------------------------------- |
| `DOC601` | Class docstring contains fewer class attributes than actual class attributes. |
| `DOC602` | Class docstring contains more class attributes than in actual class attributes. |
| `DOC603` | Class docstring attributes are different from actual class attributes. |
| `DOC604` | Attributes are the same in docstring and class def, but are in a different order. |
| `DOC605` | Attribute names match, but type hints in these attributes do not match |

More about checking class attributes:
https://jsh9.github.io/pydoclint/checking_class_attributes.html

0 comments on commit 1a270b0

Please sign in to comment.