diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 63f7350761..b477130c40 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -52,7 +52,8 @@ jobs: steps: - uses: ansys/actions/code-style@v4 with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} + # DBG + python-version: '3.8' doc-style: name: "Doc style checks" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ec407a8978..5487072833 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,3 +28,9 @@ repos: - id: pydocstyle additional_dependencies: [toml] exclude: "tests/" + +- repo: https://github.com/numpy/numpydoc + rev: v1.6.0 + hooks: + - id: numpydoc-validation + exclude: "^(src/ansys/stk/internal/|tests/)" diff --git a/pyproject.toml b/pyproject.toml index 580ee95680..88ab7efcbd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ tests = [ doc = [ "ansys-sphinx-theme==0.12.0", "enum-tools[sphinx]==0.11.0", - "numpydoc==1.5.0", + "numpydoc==1.6.0", "sphinx==7.2.6", "sphinx-design==0.5.0", "sphinx-jinja==2.0.2", @@ -66,6 +66,26 @@ src_paths = ["examples", "doc", "src", "tests"] [tool.codespell] ignore-words = "doc/styles/Vocab/ANSYS/accept.txt" +[tool.numpydoc_validation] +checks = [ + "GL06", # Found unknown section + "GL07", # Sections are in the wrong order. + # "GL08", # The object does not have a docstring + "GL09", # Deprecation warning should precede extended summary + "GL10", # reST directives {directives} must be followed by two colons + "SS01", # No summary found + # "SS02", # Summary does not start with a capital letter + # "SS03", # Summary does not end with a period + # "SS04", # Summary contains heading whitespaces + # "SS05", # Summary must start with infinitive verb, not third person + "RT02", # The first line of the Returns section should contain only the + # type, unless multiple values are being returned" +] +exclude = [ # don't report on objects that match any of these regex + '\.undocumented_method$', + '\.__repr__$', +] + [tool.coverage.run] relative_files = true