Skip to content

Commit c463c8f

Browse files
docs: add pre-commit
1 parent c788fc1 commit c463c8f

File tree

3 files changed

+40
-3
lines changed

3 files changed

+40
-3
lines changed

doc/source/contribute.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ improving documentation. Below are the guidelines to follow when contributing.
88

99
.. toctree::
1010
:hidden:
11-
:maxdepth: 3
11+
:maxdepth: 1
1212
:caption: Contribute
1313

1414
User<contribute/user>

doc/source/contribute/developer.rst

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ isolated Python virtual environment. To install Tox, run:
149149
python -m pip install tox
150150
151151
Finally, verify the installation by listing all the different environments
152-
(automation rules) for PySTK:
152+
(automation rules) for Ansys Sphinx theme:
153153

154154
.. code-block:: text
155155
@@ -172,3 +172,40 @@ Finally, verify the installation by listing all the different environments
172172
* - {{ name }}
173173
- {{ description }}
174174
{% endfor %}
175+
176+
177+
Adhere to code style
178+
--------------------
179+
180+
Ansys Sphinx theme follows the PEP8 standard as outlined in
181+
`PEP 8 <https://dev.docs.pyansys.com/coding-style/pep8.html>`_ in
182+
the *PyAnsys Developer's Guide* and implements style checking using
183+
`pre-commit <https://pre-commit.com/>`_.
184+
185+
To ensure your code meets minimum code styling standards, run these commands::
186+
187+
pip install pre-commit
188+
pre-commit run --all-files
189+
190+
or use tox as above::
191+
192+
tox -e code-style
193+
194+
You can also install this as a pre-commit hook by running this command::
195+
196+
pre-commit install
197+
198+
This way, it's not possible for you to push code that fails the style checks::
199+
200+
$ pre-commit install
201+
$ git commit -am "added my cool feature"
202+
ruff.....................................................................Passed
203+
ruff-format..............................................................Passed
204+
codespell................................................................Passed
205+
prettier.................................................................Passed
206+
check for merge conflicts................................................Passed
207+
debug statements (python)................................................Passed
208+
check yaml...............................................................Passed
209+
trim trailing whitespace.................................................Passed
210+
Validate GitHub Workflows................................................Passed
211+
Add License Headers......................................................Passed

doc/source/contribute/user.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,6 @@ Share your work
9797
===============
9898

9999
If you have used Ansys Sphinx theme to create something interesting, share it with the rest
100-
of the community. You can share your work in the `Ansys sphinx theme issues`_. Include
100+
of the community. You can share your work in the `Ansys sphinx theme issue`_. Include
101101
a brief description of your work and any relevant links that others may find
102102
useful.

0 commit comments

Comments
 (0)