Skip to content

Commit

Permalink
Implementing vale (#106)
Browse files Browse the repository at this point in the history
* Implementing vale

* Implementing vale in CI

* Solving vale errors/warnings
  • Loading branch information
RobPasMue authored Aug 22, 2022
1 parent 8c9587c commit 34b5d94
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 4 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,28 @@ jobs:
- name: Test with tox
run: tox -e style

docs-style:
name: Documentation Style Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Running Vale
uses: errata-ai/vale-action@reviewdog
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
files: doc
reporter: github-pr-check
level: error
filter_mode: nofilter
fail_on_error: true
vale_flags: "--config=doc/.vale.ini"

docs:
name: Documentation
runs-on: ubuntu-latest
needs: docs-style
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -76,6 +95,7 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest
needs: style
steps:
- uses: actions/checkout@v2
- name: Set up Python
Expand All @@ -99,7 +119,7 @@ jobs:
release:
name: Release
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: [style, docs, build]
needs: [style, docs-style, docs, build]
runs-on: ubuntu-latest

steps:
Expand Down
32 changes: 32 additions & 0 deletions doc/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Core settings
# =============

# Location of our `styles`
StylesPath = "styles"

# The options are `suggestion`, `warning`, or `error` (defaults to “warning”).
MinAlertLevel = warning

# By default, `code` and `tt` are ignored.
IgnoredScopes = code, tt

# By default, `script`, `style`, `pre`, and `figure` are ignored.
SkippedScopes = script, style, pre, figure

# WordTemplate specifies what Vale will consider to be an individual word.
WordTemplate = \b(?:%s)\b

# List of Packages to be used for our guidelines
Packages = Google

# Define the Ansys vocabulary
Vocab = ANSYS

[*.{md,rst}]

# Apply the following styles
BasedOnStyles = Vale, Google

# Removing Google-specific rule - Not applicable under some circumstances
Google.WordList = NO
Google.Colons = NO
2 changes: 1 addition & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==========================================
Ansys Sphinx theme documentation |version|
Ansys Sphinx Theme documentation |version|
==========================================


Expand Down
4 changes: 2 additions & 2 deletions doc/source/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Here is how you use ``html_theme_options`` to add breadcrumbs to the Ansys Sphin
}
When you are on the module homepage, the breadcrumb displays the homepage
title. However, this title is not accessible to Sphinx from other
title. However, this title is not accessible to Sphinx from other
documentation pages. Therefore, the ``html_short_title`` is used as the display
text for the breadcrumb on the documentation homepage. To ensure a consistent user
experience, you should ensure that the ``html_short_title`` (or optionally
Expand All @@ -49,7 +49,7 @@ Customize icons
The Ansys Sphinx theme allows you to control what icons are shown in the
navigation bar.

- Conprehensive information on customizing icons is available in
- Comprehensive information on customizing icons is available in
`Configure icon links <https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/configuring.html?highlight=icons#configure-icon-links>`_
in the documentation for the PyData Sphinx theme.
- For information on using `Font Awesome <https://fontawesome.com/>`, an icon
Expand Down
4 changes: 4 additions & 0 deletions doc/styles/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!Vocab
!Vocab/**
!.gitignore
4 changes: 4 additions & 0 deletions doc/styles/Vocab/ANSYS/accept.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ANSYS
Ansys
ansys
Ansys Sphinx Theme
Empty file.

0 comments on commit 34b5d94

Please sign in to comment.