Skip to content

Commit b9ec75b

Browse files
committed
Clean links in doc files
1 parent 78b1358 commit b9ec75b

File tree

6 files changed

+15
-60
lines changed

6 files changed

+15
-60
lines changed

doc/source/coding_style/flake8.rst

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
Style Guide Enforcement
44
=======================
5-
This topic describes the use of `Flake8`_ for `PEP8`_ style
5+
This topic describes the use of `flake8`_ for `PEP 8`_ style
66
enforcement and the minimum standards expected. PyAnsys libraries
77
are expected to be consistent with these guidelines.
88

9-
.. _PEP8: https://www.python.org/dev/peps/pep-0008/
10-
119
Flake8
1210
~~~~~~
1311
`Flake8`_ is a Python tool for enforcing code styling. It is a wrapper
@@ -16,12 +14,6 @@ around the following three tools: `PyFlakes`_, `pycodestyle`_, and
1614
checking the code against a variety of style rules, such as line length,
1715
code complexity, and whitespace.
1816

19-
.. _Flake8: https://flake8.pycqa.org/en/latest/index.html
20-
.. _PyFlakes: https://pypi.org/project/pyflakes/
21-
.. _pycodestyle: https://pypi.org/project/pycodestyle/
22-
.. _`Ned Batchelder's McCabe script for complexity`: https://github.com/PyCQA/mccabe
23-
.. _configuring-flake8:
24-
2517
Configuring Flake8
2618
------------------
2719
Flake8 supports configuring a specific set of style rules to
@@ -70,7 +62,7 @@ The example configuration defines the following options:
7062

7163
- ``max-line-length``
7264
Denotes the maximum line length for any one line of code.
73-
The `PEP8`_ standard advises a maximum line length of 79. Because
65+
The `PEP 8`_ standard advises a maximum line length of 79. Because
7466
this is a bit limiting in some cases, the maximum line length
7567
recommended for a PyAnsys library is 100.
7668

@@ -106,25 +98,22 @@ base.
10698
Utilizing Black
10799
~~~~~~~~~~~~~~~
108100
Manually checking for code styling can be a tedious task. Luckily,
109-
several Python tools for auto-formatting code to meet PEP8 standards
101+
several Python tools for auto-formatting code to meet `PEP 8`_ standards
110102
are available to help with this. The PyAnsys project suggests the use of the
111103
the formatting tool `black`_.
112104

113105
On completing a code change, and before committing, `black`_ can be
114-
run to reformat the code, following the PEP8 guidelines enforced through
115-
Flake8. This will limit any manual code changes needed to address style
106+
run to reformat the code, following the `PEP 8`_ guidelines enforced through
107+
`flake8`_. This will limit any manual code changes needed to address style
116108
rules.
117109

118-
.. _black: https://black.readthedocs.io/en/stable/
119110

120111
Optionally, it is possible to automate the use of `black`_. This can be
121112
done with the tool `pre-commit`_. Setting up a `pre-commit hook
122113
to run black <https://black.readthedocs.io/en/stable/integrations/source_version_control.html>`_
123114
will automatically format the code before committing. This simple way of
124115
incorporating code style checks into the development workflow to maintain
125-
PEP8 guidelines requires minimal manual effort.
126-
127-
.. _pre-commit: https://pre-commit.com/
116+
`PEP 8`_ guidelines requires minimal manual effort.
128117

129118

130119
Minimum Standards
@@ -232,21 +221,4 @@ Your ``.flake8`` file should be:
232221
max-line-length = 100
233222
statistics = True
234223
235-
236-
.. _W191: https://www.flake8rules.com/rules/W191.html
237-
.. _W291: https://www.flake8rules.com/rules/W291.html
238-
.. _W293: https://www.flake8rules.com/rules/W293.html
239-
.. _W391: https://www.flake8rules.com/rules/W391.html
240-
.. _E115: https://www.flake8rules.com/rules/E115.html
241-
.. _E117: https://www.flake8rules.com/rules/E117.html
242-
.. _E122: https://www.flake8rules.com/rules/E122.html
243-
.. _E124: https://www.flake8rules.com/rules/E124.html
244-
.. _E125: https://www.flake8rules.com/rules/E125.html
245-
.. _E225: https://www.flake8rules.com/rules/E225.html
246-
.. _E231: https://www.flake8rules.com/rules/E231.html
247-
.. _E301: https://www.flake8rules.com/rules/E301.html
248-
.. _E303: https://www.flake8rules.com/rules/E303.html
249-
.. _E501: https://www.flake8rules.com/rules/E501.html
250-
.. _F401: https://www.flake8rules.com/rules/F401.html
251-
.. _F403: https://www.flake8rules.com/rules/F403.html
252-
224+
.. include:: ../links.rst

doc/source/coding_style/index.rst

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
.. _coding_style:
2-
31
Coding Style
42
************
53

6-
PyAnsys libraries are expected to follow `PEP8`_ and
4+
PyAnsys libraries are expected to follow `PEP 8`_ and
75
be consistent in style and formatting with the 'big three'
86
data science libraries: `NumPy`_, `SciPy`_, and `pandas`_.
97

10-
.. _NumPy: https://numpy.org/
11-
.. _SciPy: https://www.scipy.org/
12-
.. _pandas: https://pandas.pydata.org/
13-
.. _PEP8: https://www.python.org/dev/peps/pep-0008/
14-
158

169
.. todo::
1710

@@ -27,3 +20,5 @@ data science libraries: `NumPy`_, `SciPy`_, and `pandas`_.
2720
pep8_best_practices
2821
beyond_pep8
2922
flake8
23+
24+
.. include:: ../links.rst

doc/source/coding_style/pep8_best_practices.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ they apply to PyAnsys libraries. The goal is for PyAnsys libraries to
77
be consistent in style and formatting with the `big three`
88
data science libraries: `NumPy`_, `SciPy`_, and `pandas`_.
99

10-
.. _NumPy: https://numpy.org/
11-
.. _SciPy: https://www.scipy.org/
12-
.. _pandas: https://pandas.pydata.org/
13-
.. _PEP8: https://www.python.org/dev/peps/pep-0008/
14-
1510

1611
Imports
1712
~~~~~~~

doc/source/documentation_style/formatting-tools.rst

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,4 @@ under the ``[tool.pydocstyle]`` entry:
8888
[tool.pydocstyle]
8989
# Additional configuration
9090
91-
92-
.. _interrogate: https://interrogate.readthedocs.io/en/latest/
93-
.. _docstr-coverage: https://docstr-coverage.readthedocs.io/en/latest/index.html
94-
.. _docstring-coverage: https://bitbucket.org/DataGreed/docstring-coverage/wiki/Home
95-
.. _pytest-cov: https://pytest-cov.readthedocs.io/en/latest/
96-
.. _doctest: https://docs.python.org/3/library/doctest.html
97-
.. _PEP 257: http://www.python.org/dev/peps/pep-0257/
98-
.. _docformatter: https://github.com/PyCQA/docformatter
99-
.. _codespell: https://github.com/codespell-project/codespell
100-
.. _pytest-cov: https://pytest-cov.readthedocs.io/en/latest/
91+
.. include:: ../links.rst

doc/source/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@
1313
coding_style/index
1414
documentation_style/index
1515
abstractions/index
16+
17+
.. include:: links.rst

doc/source/packaging/structure.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ template can be used:
282282
.. REFERENCES & LINKS
283283
284284
.. _MIT License: https://opensource.org/licenses/MIT
285-
.. _PEP 420: https://peps.python.org/pep-0420/
286285
.. _native namespace packages: https://packaging.python.org/en/latest/guides/packaging-namespace-packages/#native-namespace-packages
287286
.. _Namespace Packages: https://packaging.python.org/guides/packaging-namespace-packages/
288287
.. _PyAnsys: https://docs.pyansys.com/
@@ -295,7 +294,8 @@ template can be used:
295294
.. _ansys-api-mapdl: https://pypi.org/project/ansys-api-mapdl/
296295
.. _reStructuredText Markup Syntax: https://docutils.sourceforge.io/rst.html
297296
.. _Markdown Syntax: https://www.markdownguide.org/basic-syntax/
298-
.. _PEP 518: https://peps.python.org/pep-0518/
299297
.. _Building and Distributing Packages with Setuptools: https://setuptools.pypa.io/en/latest/setuptools.html
300298
.. _Configuring setuptools using setup.cfg files: https://setuptools.pypa.io/en/latest/userguide/declarative_config.html
301299
.. _setuptools: https://setuptools.pypa.io/en/latest/index.html
300+
301+
.. include:: ../links.rst

0 commit comments

Comments
 (0)