From e3c36e1e44caba5684f7195fcfa031e18417e20f Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Fri, 12 Jun 2026 15:03:01 +0200 Subject: [PATCH 1/2] fix: vale configuration for examples --- .github/workflows/ci_cd_pr.yml | 5 +---- .github/workflows/ci_cd_release.yml | 5 +---- doc/.vale.ini | 16 ++++++++++++++-- tox.ini | 5 ++--- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 0947c3ba8e..6d44a8b124 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -145,11 +145,8 @@ jobs: # Find all .py files inside the examples/ directory, excluding those with an underscore python_files=$(find examples -type f -name "*.py" ! -name "*_*") - # TODO: include Python files too. See Vale issue - # https://github.com/errata-ai/vale/issues/858 # Combine both file lists and convert them to a JSON array - # vale_files=$(echo -e "${rst_files}\n${python_files}" | jq -R . | jq -s .) - vale_files=$(echo -e "${rst_files}" | jq -R . | jq -s .) + vale_files=$(echo -e "${rst_files}\n${python_files}" | jq -R . | jq -s .) echo "files=$(jq -c <<< "${vale_files}")" >> "${GITHUB_OUTPUT}" - uses: ansys/actions/doc-style@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 diff --git a/.github/workflows/ci_cd_release.yml b/.github/workflows/ci_cd_release.yml index b42853c059..b4ba3043fd 100644 --- a/.github/workflows/ci_cd_release.yml +++ b/.github/workflows/ci_cd_release.yml @@ -75,11 +75,8 @@ jobs: # Find all .py files inside the examples/ directory, excluding those with an underscore python_files=$(find examples -type f -name "*.py" ! -name "*_*") - # TODO: include Python files too. See Vale issue - # https://github.com/errata-ai/vale/issues/858 # Combine both file lists and convert them to a JSON array - # vale_files=$(echo -e "${rst_files}\n${python_files}" | jq -R . | jq -s .) - vale_files=$(echo -e "${rst_files}" | jq -R . | jq -s .) + vale_files=$(echo -e "${rst_files}\n${python_files}" | jq -R . | jq -s .) echo "files=$(jq -c <<< "${vale_files}")" >> "${GITHUB_OUTPUT}" - uses: ansys/actions/doc-style@d946b24b9a765f4169bcc94afdb27bd1a0533741 # v10.3.2 diff --git a/doc/.vale.ini b/doc/.vale.ini index 31470cc95f..ee89f7a571 100644 --- a/doc/.vale.ini +++ b/doc/.vale.ini @@ -26,7 +26,7 @@ Vocab = ANSYS # Python + Markdown py = md -[*.{py,md,rst}] +[*.{md,rst}] # Apply the following styles BasedOnStyles = Vale, Google @@ -34,4 +34,16 @@ Google.Headings = NO Vale.Terms = NO TokenIgnores = (\$+[^\n$]+\$+), (:.*:`.*`)|(<.*>) -BlockIgnores = (?s) """([^"]*)""" \ No newline at end of file + +[*.py] + +# Apply the following styles +BasedOnStyles = Vale, Google +Google.Headings = NO +Vale.Terms = NO + +TokenIgnores = (\$+[^\n$]+\$+), (:.*:`.*`)|(<.*>) + +# Ignore triple-quoted docstrings and non-comment Python code lines so that +# only Jupytext-style comment cells (lines starting with "#") are checked. +BlockIgnores = (?s)("""[\s\S]*?"""), (?m)^[^#\n][^\n]* \ No newline at end of file diff --git a/tox.ini b/tox.ini index ad00ab681a..00e92ce47e 100644 --- a/tox.ini +++ b/tox.ini @@ -146,10 +146,9 @@ platform = linux: linux windows: win32 commands = - linux: bash -c 'rst_files=$(find {toxinidir}/doc/source -type f -name "*.rst" ! -path "doc/source/api/*") && py_files=$(find {toxinidir}/examples -type f -name "*.py" ! -name "*_*") && vale_files="$rst_files $py_files" && vale sync --config="{toxinidir}/doc/.vale.ini" && vale --config="{toxinidir}/doc/.vale.ini" $rst_files' + linux: bash -c 'rst_files=$(find {toxinidir}/doc/source -type f -name "*.rst" ! -path "doc/source/api/*") && py_files=$(find {toxinidir}/examples -type f -name "*.py" ! -name "*_*") && vale_files="$rst_files $py_files" && vale sync --config="{toxinidir}/doc/.vale.ini" && vale --config="{toxinidir}/doc/.vale.ini" $vale_files' windows: cmd /c "dir /s /b {toxinidir}\doc\source\*.rst | findstr /v /i \doc\source\api\ > tmp_files.txt" - # see .github/workflows/ci_cd_pr.yml#L135 - python examples are currently excluded - #windows: cmd /c "dir /s /b {toxinidir}\examples\*.py | findstr /v /i examples.*_.* >> tmp_files.txt" + windows: cmd /c "dir /s /b {toxinidir}\examples\*.py | findstr /v /i examples.*_.* >> tmp_files.txt" windows: cmd /c "vale sync --config="{toxinidir}\doc\.vale.ini"" windows: cmd /v:on /c "set vale_files="" && (for /f %i in (tmp_files.txt) do @set vale_files="%i" !vale_files!) && @del tmp_files.txt && vale --config="{toxinidir}\doc\.vale.ini" !vale_files!" From cea8cb7290571e2212ea8eeaa88ca3d772c65c73 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Fri, 12 Jun 2026 13:06:05 +0000 Subject: [PATCH 2/2] chore: adding changelog file 1034.fixed.md [dependabot-skip] --- doc/source/changelog/1034.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/source/changelog/1034.fixed.md diff --git a/doc/source/changelog/1034.fixed.md b/doc/source/changelog/1034.fixed.md new file mode 100644 index 0000000000..c373627876 --- /dev/null +++ b/doc/source/changelog/1034.fixed.md @@ -0,0 +1 @@ +Vale configuration for examples