- Enforce Google-style docstrings in pre-commit hooks:
- Add pydocstyle, pydoclint, and interrogate to Pipenv and pre-commit
- Configure pydocstyle for PEP 257 and Google-style compliance
- Set pydoclint to enforce function signature correctness
- Ensure 100% function and class docstring coverage with interrogate:
- There are some exceptions, e.g. init, module-level.
- More exceptions can be added if the tooling is found to be too
strict.
- Refine Black hook ordering to ensure all hooks run on formatted files:
- Fail commit if formatting is needed (--check)
- Auto-format files in a separate step
- Prevent bypassing docstring checks by staging unformatted files
- Ensure return type consistency (DOC203 best practices):
- Require both return type hints (-> type) and docstring return types
- Explain rationale for requiring both:
- Type hints help with static analysis and runtime type checking
- Docstring return types improve readability and documentation clarity
- Pre-commit hooks validate consistency across both formats
- Update pre-commit hooks to explicitly check for this requirement
- Restructure pre-commit and linting configuration:
- Move .pydocstyle.ini, .flake8, and pyproject.toml to the root
- Update pre-commit hooks to reference these configs in the new structure
- Modify tox.ini to prevent packaging errors and improve workflow:
- Add `skipsdist = True` to disable setuptools packaging
- Set `usedevelop = False` to prevent unintended package installation
- Ensure `tox` only runs documentation and linting tasks
- Aligns with StarlingX repository standards and prevents conflicts
- Retain the pre-commit/ directory for potential future hooks
- Update documentation and improve contributor guidance:
- Add CONTRIBUTING.rst with detailed contribution guidelines
- Create contributors.rst in doc/source for Sphinx-rendered docs
- Link contributors.rst in index.rst for visibility in generated docs
- Ensure contributing.rst references the latest CONTRIBUTING.rst
- Document VSCode and PyCharm auto-doc settings in CONTRIBUTING.rst
This commit ensures consistent docstring enforcement, improves
pre-commit integration, aligns with best practices, and enhances
contributor documentation.
Change-Id: Iba282c20502adb81a7739ec6c3ed8b6f3bc45077
Signed-off-by: Andrew Vaillancourt <andrew.vaillancourt@windriver.com>
36 lines
810 B
TOML
36 lines
810 B
TOML
[[source]]
|
|
name = "pypi"
|
|
url = "https://pypi.org/simple"
|
|
verify_ssl = true
|
|
|
|
[requires]
|
|
python_version = "3.11"
|
|
|
|
[packages]
|
|
# Linting and Static Analysis
|
|
pre-commit = "==3.7.0"
|
|
black = "==24.3.0"
|
|
isort = "==5.13.2"
|
|
flake8 = "==7.0.0"
|
|
|
|
# Docstring Compliance and Enforcement
|
|
pydocstyle = "==6.3.0" # Enforce PEP 257 and Google-style docstrings
|
|
pydoclint = "==0.4.1" # Validate function signatures match docstrings (Google-style)
|
|
interrogate = "==1.5.0" # Ensure all functions and classes have docstrings
|
|
|
|
# Tools Packages
|
|
pytest = "==8.1.1"
|
|
paramiko = "==3.4.0"
|
|
json5 = "==0.9.24"
|
|
selenium = "==4.20.0"
|
|
django = "==5.0.6"
|
|
psycopg2-binary = "==2.9.9"
|
|
jinja2 = "*"
|
|
requests = "*"
|
|
|
|
# Documentation Tools
|
|
sphinx = "==8.1.3"
|
|
sphinx-autobuild = "==2024.2.4"
|
|
openstackdocstheme = "==3.4.1"
|
|
reno = "==4.1.0"
|