Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update default vale version 3.4.1 #410

Merged
merged 17 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 1 addition & 33 deletions doc-style/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ inputs:
vale-version:
description: >
Version number for Vale.
# TODO: use the latest stable version from Vale, see issue
# https://github.com/ansys/actions/issues/350
default: '2.29.6'
default: '3.4.1'
required: false
type: string

Expand All @@ -73,36 +71,6 @@ runs:
uses: actions/checkout@v4
if: inputs.checkout == 'true'

# TODO: remove this deprecation in ansys/actions@v6

- name: "Build deprecation warning"
if: startswith(inputs.vale-version, '2.')
shell: bash
run: |
deprecation_text="
Ansys Actions v6 will include by default Vale version v3. For
migrating, please update your 'doc/.vale.ini' file and 'doc/styles'
directory as in this pull-request https://github.com/ansys/pymechanical/pull/613
"
echo "DEPRECATION_TEXT=$(echo $deprecation_text)" >> $GITHUB_ENV

- uses: ansys/actions/_logging@main
if: startswith(inputs.vale-version, '2.')
with:
level: "WARNING"
message: >
Ansys Actions v6 will include by default Vale version v3. For
migrating, please update your "doc/.vale.ini" file and "doc/styles"
directory as in this pull-request https://github.com/ansys/pymechanical/pull/613

- name: "Raise deprecation warning outside of the CI/CD logs"
shell: bash
if: startswith(inputs.vale-version, '2.')
run: |
echo "::warning ::${DEPRECATION_TEXT}"

# TODO: end

- name: "Run Vale"
uses: errata-ai/vale-action@reviewdog
env:
Expand Down
48 changes: 48 additions & 0 deletions doc/source/migrations/docs-style-vale-version-update.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.. _docs_style_vale_update:

Doc-style action - migrating from Vale ``2.X`` to ``3.X``
=========================================================

When migrating ``ansys/actions/doc-style`` from ``v5`` to higher versions, the default Vale version is upgraded to ``v3``.
Certain changes must be made to the repository to ensure that the ``doc-style`` action performs without issues.
Additionally, it is possible to use ``ansys/actions`` older than ``v5`` while utilizing Vale ``v3``
as input for the ``doc-style`` action like below.

.. code:: yaml

doc-style:
name: Documentation Style Check
runs-on: ubuntu-latest
steps:
- name: PyAnsys documentation style checks
uses: ansys/actions/doc-style@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
vale-version: "3.4.1"

In any of the preceding conditions there are two changes needs to implemented:

1. Update ``Vocab/ANSYS`` path

In order to comply with the requirements of Vale ``v3``, it is necessary to update the vocabularies
path under the ``doc/styles`` directory. Specifically, the default vocabularies path should be modified from
``Vocab/ANSYS`` to ``config/vocabularies/ANSYS``. This adjustment ensures that Vale can locate the required vocabulary files.

.. note:: Update ``.gitignore``

If your repository has ``.gitignore`` files under ``styles`` folder, please update them according to vocabularies changes

2. Turn off ``Vale.Terms``

Locate the section in your ``doc/.vale.ini`` file where styles are applied.
Add ``Vale.Terms = NO`` under the section where styles are applied, typically marked with ``[*.{rst}]``.

.. code:: ini

[*.{rst}]
BasedOnStyles = Vale, Google
Vale.Terms = NO


Finally, verify that the ``doc-style`` action is functioning correctly with the latest changes applied.
Run the action and ensure that the documentation style checks are performed without any issues.
5 changes: 4 additions & 1 deletion doc/source/migrations/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from one version of the actions to another, and other upstream dependencies that
have been updated.

Development version

Check warning on line 10 in doc/source/migrations/index.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/migrations/index.rst#L10

[Google.Headings] 'Development version' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'Development version' should use sentence-style capitalization.", "location": {"path": "doc/source/migrations/index.rst", "range": {"start": {"line": 10, "column": 1}}}, "severity": "WARNING"}
-------------------

**New features:**
Expand All @@ -22,12 +22,14 @@

**Breaking changes:**

- N/A
- Upgrade default ``vale`` version from ``2.29.6`` to ``3.4.1`` in ``ansys/actions/doc-style`` action.
- Vale configuration file ``.vale.ini`` and ``Vocab/ANSYS`` has to be changed.

**Migration steps:**
RobPasMue marked this conversation as resolved.
Show resolved Hide resolved

- To set up your repository to use the ``ansys/actions/doc-changelog`` action, see the :ref:`docs_changelog_action_setup`.
- To set up your repository to use the ``ansys/actions/doc-deploy-changelog`` action, see the :ref:`docs_deploy_changelog_action_setup`.
- To set up your repository to use the ``ansys/actions/doc-style`` action, see the :ref:`docs_style_vale_update`.

Version ``v5``
--------------
Expand Down Expand Up @@ -84,3 +86,4 @@

docs-changelog-setup
docs-deploy-changelog-setup
docs-style-vale-version-update