Skip to content

Commit

Permalink
Replace flake8-rst-docstrings and darglint with pydoclint
Browse files Browse the repository at this point in the history
As highlighted [here][github discussion], pydoclint is a much faster
alternative.

[github discussion]: cjolowicz#1282 (comment)
  • Loading branch information
bruno-fs committed May 28, 2024
1 parent 6a8c291 commit 1a60c78
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 107 deletions.
2 changes: 0 additions & 2 deletions {{cookiecutter.project_name}}/.darglint

This file was deleted.

6 changes: 0 additions & 6 deletions {{cookiecutter.project_name}}/.flake8

This file was deleted.

11 changes: 5 additions & 6 deletions {{cookiecutter.project_name}}/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ repos:
entry: check-yaml
language: system
types: [yaml]
- id: darglint
name: darglint
entry: darglint
language: system
types: [python]
stages: [manual]
- id: end-of-file-fixer
name: Fix End of Files
entry: end-of-file-fixer
Expand All @@ -33,6 +27,11 @@ repos:
language: system
types: [text]
stages: [commit, push, manual]
- id: pydoclint
name: pydoclint
entry: pydoclint
language: system
types: [python]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.6.0
hooks:
Expand Down
3 changes: 1 addition & 2 deletions {{cookiecutter.project_name}}/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,9 @@ def precommit(session: Session) -> None:
]
session.install(
"ruff",
"darglint",
"flake8-rst-docstrings",
"pre-commit",
"pre-commit-hooks",
"pydoclint",
)
session.run("pre-commit", *args)
if args and args[0] == "install":
Expand Down
114 changes: 26 additions & 88 deletions {{cookiecutter.project_name}}/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions {{cookiecutter.project_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ click = ">=8.0.1"
[tool.poetry.dev-dependencies]
Pygments = ">=2.10.0"
coverage = { extras = ["toml"], version = ">=6.2" }
darglint = ">=1.8.1"
flake8-rst-docstrings = ">=0.2.5"
furo = ">=2021.11.12"
mypy = ">=0.930"
myst-parser = { version = ">=0.16.1" }
pre-commit = ">=2.16.0"
pre-commit-hooks = ">=4.1.0"
pydoclint = "^0.4.1"
pytest = ">=6.2.5"
ruff = ">=0.4.6"
safety = ">=1.10.3"
Expand All @@ -41,7 +41,6 @@ sphinx-autobuild = ">=2021.3.14"
sphinx-click = ">=3.0.2"
typeguard = ">=2.13.3"
xdoctest = { extras = ["colors"], version = ">=0.15.10" }
myst-parser = { version = ">=0.16.1" }

[tool.poetry.scripts]
{{cookiecutter.project_name}} = "{{cookiecutter.package_name}}.__main__:main"
Expand Down Expand Up @@ -112,6 +111,11 @@ extend-ignore = [
[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.pydoclint]
style = 'google'
exclude = '\.git|\.nox'
arg-type-hints-in-docstring = false

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 1a60c78

Please sign in to comment.