Skip to content

Commit

Permalink
Add a linting integrations section to docs (#9076)
Browse files Browse the repository at this point in the history
  • Loading branch information
Viicos committed Mar 21, 2024
1 parent 04cc047 commit e58134b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/integrations/datamodel_code_generator.md
Expand Up @@ -4,7 +4,7 @@ The [datamodel-code-generator](https://github.com/koxudaxi/datamodel-code-genera

* OpenAPI 3 (YAML/JSON)
* JSON Schema
* JSON/YAML/CSV Data (which will converted to JSON Schema)
* JSON/YAML/CSV Data (which will be converted to JSON Schema)
* Python dictionary (which will be converted to JSON Schema)
* GraphQL schema

Expand Down
16 changes: 16 additions & 0 deletions docs/integrations/linting.md
@@ -0,0 +1,16 @@
## Flake8 plugin

If using Flake8 in your project, a [plugin](https://pypi.org/project/flake8-pydantic/) is available
and can be installed using the following:

```bash
pip install flake8-pydantic
```

The lint errors provided by this plugin are namespaced under the `PYDXXX` code. To ignore some unwanted
rules, the Flake8 configuration can be adapted:

```ini
[flake8]
extend-ignore = PYD001,PYD002
```
2 changes: 2 additions & 0 deletions mkdocs.yml
Expand Up @@ -130,6 +130,7 @@ nav:
- datamodel-code-generator: integrations/datamodel_code_generator.md
- devtools: integrations/devtools.md
- Rich: integrations/rich.md
- Linting: integrations/linting.md
- Blog: https://blog.pydantic.dev/
- Pydantic People: pydantic_people.md

Expand Down Expand Up @@ -196,6 +197,7 @@ plugins:
'usage/model_config.md': 'api/config.md'
'usage/devtools.md': 'integrations/devtools.md'
'usage/rich.md': 'integrations/rich.md'
'usage/linting.md': 'integrations/linting.md'
'usage/types.md': 'concepts/types.md'
'usage/types/secrets.md': 'examples/secrets.md'
'usage/types/string_types.md': 'api/types.md#pydantic.types.StringConstraints'
Expand Down

0 comments on commit e58134b

Please sign in to comment.