File tree Expand file tree Collapse file tree 6 files changed +40
-22
lines changed Expand file tree Collapse file tree 6 files changed +40
-22
lines changed Original file line number Diff line number Diff line change 2
2
flake8 codes
3
3
=================
4
4
5
- ============== =====================================================================
6
- Code Description
7
- ============== =====================================================================
8
- SXL001 Double backticked variable should be a link to Python documentation.
9
- ============== =====================================================================
5
+ .. flake8-codes :: flake8_sphinx_links
6
+
7
+ SXL001
Original file line number Diff line number Diff line change 46
46
'sphinxcontrib.default_values' ,
47
47
'sphinxcontrib.toctree_plus' ,
48
48
'seed_intersphinx_mapping' ,
49
+ 'sphinx_toolbox.pre_commit' ,
50
+ 'sphinx_toolbox.flake8' ,
49
51
]
50
52
51
53
sphinxemoji_style = 'twemoji'
Original file line number Diff line number Diff line change @@ -133,15 +133,9 @@ Use as a pre-commit hook
133
133
134
134
See `pre-commit <https://github.com/pre-commit/pre-commit >`_ for instructions
135
135
136
- Sample `.pre-commit-config.yaml `:
136
+ Sample `` .pre-commit-config.yaml ` `:
137
137
138
- .. code-block :: yaml
139
-
140
- - repo: https://gitlab.com/pycqa/flake8
141
- rev: 3.8.1
142
- hooks:
143
- - id: flake8
144
- additional_dependencies: [flake8-sphinx-links==0.0.4]
138
+ .. pre-commit :flake8 :: 0.0.4
145
139
146
140
147
141
.. toctree ::
@@ -156,8 +150,13 @@ Sample `.pre-commit-config.yaml`:
156
150
codes
157
151
examples
158
152
API Reference<docs>
153
+
154
+ .. toctree ::
155
+ :maxdepth: 3
156
+ :caption: Contributing
157
+
158
+ contributing
159
159
Source
160
- Building
161
160
162
161
.. start links
163
162
Original file line number Diff line number Diff line change 1
1
autodocsumm >= 0.2.0
2
- default_values >= 0.2.0
3
- domdf_sphinx_theme >= 0.1.0
4
- extras_require >= 0.2.0
5
- seed_intersphinx_mapping >= 0.1.1
2
+ default-values >= 0.2.0
3
+ domdf-sphinx-theme >= 0.1.0
4
+ extras-require >= 0.2.0
5
+ seed-intersphinx-mapping >= 0.1.1
6
6
sphinx >= 3.0.3
7
7
sphinx-copybutton >= 0.2.12
8
8
sphinx-notfound-page >= 0.5
9
9
sphinx-prompt >= 1.1.0
10
10
sphinx-tabs >= 1.1.13
11
- sphinx-toolbox >= 1.5 .1
11
+ sphinx-toolbox >= 1.6 .1
12
12
sphinxcontrib-httpdomain >= 1.7.0
13
13
sphinxemoji >= 0.1.6
14
- toctree_plus >= 0.0.4
14
+ toctree-plus >= 0.0.4
Original file line number Diff line number Diff line change 42
42
__version__ : str = "0.0.4"
43
43
__email__ : str = "dominic@davis-foster.co.uk"
44
44
45
+ __all__ = [
46
+ "SXL001" ,
47
+ "Visitor" ,
48
+ "Plugin" ,
49
+ "py_obj" ,
50
+ "py_obj_python" ,
51
+ "exc" ,
52
+ "class_" ,
53
+ "regex" ,
54
+ ]
55
+
45
56
SXL001 : str = "SXL001 Double backticked strings should be a link to Python documentation." # noqa: E501
46
57
58
+ #: List of keywords that should become :file:`:py:obj:\`{<keyword>}\``
47
59
py_obj : List [str ] = [
48
60
"True" ,
49
61
"False" ,
58
70
]
59
71
60
72
py_obj_python : List [str ] = ["copyright" ]
73
+ """
74
+ List of keywords that should become :file:`:py:obj:\`python:{<keyword>}\``
75
+ to prevent conflict with Sphinx objects.
76
+ """
61
77
78
+ #: List of keywords that should become :file:`:py:exc:\`{<keyword>}\``
62
79
exc : List [str ] = [
63
80
"BaseException" ,
64
81
"Exception" ,
152
169
153
170
all_objs : str = '|' .join (py_obj + py_obj_python + exc + class_ )
154
171
172
+ #: Regex to match keywords that should be Sphinx links.
155
173
regex : Pattern = re .compile (fr"(``)({ all_objs } )(``)" )
156
174
157
175
Original file line number Diff line number Diff line change @@ -37,5 +37,6 @@ classifiers:
37
37
- ' Topic :: Software Development :: Libraries :: Python Modules'
38
38
- " Topic :: Utilities"
39
39
40
- exclude_files :
41
- - setup_cfg
40
+ extra_sphinx_extensions :
41
+ - sphinx_toolbox.pre_commit
42
+ - sphinx_toolbox.flake8
You can’t perform that action at this time.
0 commit comments