Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/ci_cd_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/ci_cd_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 14 additions & 2 deletions doc/.vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,24 @@ Vocab = ANSYS
# Python + Markdown
py = md

[*.{py,md,rst}]
[*.{md,rst}]

# Apply the following styles
BasedOnStyles = Vale, Google
Google.Headings = NO
Vale.Terms = NO

TokenIgnores = (\$+[^\n$]+\$+), (:.*:`.*`)|(<.*>)
BlockIgnores = (?s) """([^"]*)"""

[*.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]*
1 change: 1 addition & 0 deletions doc/source/changelog/1034.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Vale configuration for examples
5 changes: 2 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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!"

Expand Down
Loading