Skip to content

Commit 169869e

Browse files
Fix markdownlint and pre-commit
1 parent 6fb720a commit 169869e

File tree

9 files changed

+415
-77
lines changed

9 files changed

+415
-77
lines changed

.github/workflows/pre-commit.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: pre-commit-ci
2+
3+
concurrency: # On new workflow, cancel old workflows from the same PR, branch or tag:
4+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
pull_request:
9+
push:
10+
11+
jobs:
12+
main:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-python@v4
17+
with:
18+
python-version: 3.x
19+
- uses: pre-commit/action@v3.0.1
20+
- uses: pre-commit-ci/lite-action@v1.0.3
21+
if: always()

.markdownlint.yaml

Lines changed: 259 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,259 @@
1+
# Example markdownlint configuration with all properties set to their default value
2+
3+
# Default state for all rules
4+
default: true
5+
6+
# Path to configuration file to extend
7+
extends: null
8+
9+
# MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md001.md
10+
MD001: true
11+
12+
# MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md003.md
13+
MD003:
14+
# Heading style
15+
style: "consistent"
16+
17+
# MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md004.md
18+
MD004:
19+
# List style
20+
style: "consistent"
21+
22+
# MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md005.md
23+
MD005: true
24+
25+
# MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md007.md
26+
MD007:
27+
# Spaces for indent
28+
indent: 2
29+
# Whether to indent the first level of the list
30+
start_indented: false
31+
# Spaces for first level indent (when start_indented is set)
32+
start_indent: 2
33+
34+
# MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md009.md
35+
MD009:
36+
# Spaces for line break
37+
br_spaces: 2
38+
# Allow spaces for empty lines in list items
39+
list_item_empty_lines: false
40+
# Include unnecessary breaks
41+
strict: false
42+
43+
# MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md010.md
44+
MD010:
45+
# Include code blocks
46+
code_blocks: true
47+
# Fenced code languages to ignore
48+
ignore_code_languages: []
49+
# Number of spaces for each hard tab
50+
spaces_per_tab: 1
51+
52+
# MD011/no-reversed-links : Reversed link syntax : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md011.md
53+
MD011: true
54+
55+
# MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md012.md
56+
MD012:
57+
# Consecutive blank lines
58+
maximum: 1
59+
60+
# MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md013.md
61+
MD013:
62+
# Number of characters
63+
line_length: 362
64+
# Number of characters for headings
65+
heading_line_length: 210
66+
# Number of characters for code blocks
67+
code_block_line_length: 278
68+
# Include code blocks
69+
code_blocks: true
70+
# Include tables
71+
tables: true
72+
# Include headings
73+
headings: true
74+
# Strict length checking
75+
strict: false
76+
# Stern length checking
77+
stern: false
78+
79+
# MD014/commands-show-output : Dollar signs used before commands without showing output : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md014.md
80+
MD014: true
81+
82+
# MD018/no-missing-space-atx : No space after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md018.md
83+
MD018: true
84+
85+
# MD019/no-multiple-space-atx : Multiple spaces after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md019.md
86+
MD019: true
87+
88+
# MD020/no-missing-space-closed-atx : No space inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md020.md
89+
MD020: true
90+
91+
# MD021/no-multiple-space-closed-atx : Multiple spaces inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md021.md
92+
MD021: true
93+
94+
# MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md022.md
95+
MD022:
96+
# Blank lines above heading
97+
lines_above: 1
98+
# Blank lines below heading
99+
lines_below: 1
100+
101+
# MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md023.md
102+
MD023: true
103+
104+
# MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md024.md
105+
MD024:
106+
# Only check sibling headings
107+
allow_different_nesting: false
108+
# Only check sibling headings
109+
siblings_only: false
110+
111+
# MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md025.md
112+
MD025:
113+
# Heading level
114+
level: 1
115+
# RegExp for matching title in front matter
116+
front_matter_title: "^\\s*title\\s*[:=]"
117+
118+
# MD026/no-trailing-punctuation : Trailing punctuation in heading : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md026.md
119+
MD026:
120+
# Punctuation characters
121+
punctuation: ".,;:!。,;:!"
122+
123+
# MD027/no-multiple-space-blockquote : Multiple spaces after blockquote symbol : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md027.md
124+
MD027: true
125+
126+
# MD028/no-blanks-blockquote : Blank line inside blockquote : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md028.md
127+
MD028: true
128+
129+
# MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md029.md
130+
MD029:
131+
# List style
132+
style: "one_or_ordered"
133+
134+
# MD030/list-marker-space : Spaces after list markers : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md030.md
135+
MD030:
136+
# Spaces for single-line unordered list items
137+
ul_single: 1
138+
# Spaces for single-line ordered list items
139+
ol_single: 1
140+
# Spaces for multi-line unordered list items
141+
ul_multi: 1
142+
# Spaces for multi-line ordered list items
143+
ol_multi: 1
144+
145+
# MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md031.md
146+
MD031:
147+
# Include list items
148+
list_items: true
149+
150+
# MD032/blanks-around-lists : Lists should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md032.md
151+
MD032: true
152+
153+
# MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md033.md
154+
MD033:
155+
# Allowed elements
156+
allowed_elements: [img, kbd]
157+
158+
# MD034/no-bare-urls : Bare URL used : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md034.md
159+
MD034: true
160+
161+
# MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md035.md
162+
MD035:
163+
# Horizontal rule style
164+
style: "consistent"
165+
166+
# MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md036.md
167+
MD036:
168+
# Punctuation characters
169+
punctuation: ".,;:!?。,;:!?"
170+
171+
# MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md037.md
172+
MD037: true
173+
174+
# MD038/no-space-in-code : Spaces inside code span elements : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md038.md
175+
MD038: true
176+
177+
# MD039/no-space-in-links : Spaces inside link text : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md039.md
178+
MD039: true
179+
180+
# MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md040.md
181+
MD040:
182+
# List of languages
183+
allowed_languages: []
184+
# Require language only
185+
language_only: false
186+
187+
# MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md041.md
188+
MD041:
189+
# Heading level
190+
level: 1
191+
# RegExp for matching title in front matter
192+
front_matter_title: "^\\s*title\\s*[:=]"
193+
194+
# MD042/no-empty-links : No empty links : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md042.md
195+
MD042: true
196+
197+
# MD044/proper-names : Proper names should have the correct capitalization : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md044.md
198+
MD044:
199+
# List of proper names
200+
names: []
201+
# Include code blocks
202+
code_blocks: true
203+
# Include HTML elements
204+
html_elements: true
205+
206+
# MD045/no-alt-text : Images should have alternate text (alt text) : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md045.md
207+
MD045: false
208+
209+
# MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md046.md
210+
MD046:
211+
# Block style
212+
style: "consistent"
213+
214+
# MD047/single-trailing-newline : Files should end with a single newline character : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md047.md
215+
MD047: true
216+
217+
# MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md048.md
218+
MD048:
219+
# Code fence style
220+
style: "consistent"
221+
222+
# MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md049.md
223+
MD049:
224+
# Emphasis style
225+
style: "consistent"
226+
227+
# MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md050.md
228+
MD050:
229+
# Strong style
230+
style: "consistent"
231+
232+
# MD051/link-fragments : Link fragments should be valid : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md051.md
233+
MD051: true
234+
235+
# MD052/reference-links-images : Reference links and images should use a label that is defined : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md052.md
236+
MD052:
237+
# Include shortcut syntax
238+
shortcut_syntax: false
239+
240+
# MD053/link-image-reference-definitions : Link and image reference definitions should be needed : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md053.md
241+
MD053:
242+
# Ignored definitions
243+
ignored_definitions:
244+
- "//"
245+
246+
# MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md054.md
247+
MD054:
248+
# Allow autolinks
249+
autolink: true
250+
# Allow inline links and images
251+
inline: true
252+
# Allow full reference links and images
253+
full: true
254+
# Allow collapsed reference links and images
255+
collapsed: true
256+
# Allow shortcut reference links and images
257+
shortcut: true
258+
# Allow URLs as inline links
259+
url_inline: true

.pre-commit-config.yaml

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
# https://github.com/dexpota/cheatsheets/blob/master/pre-commit
3838
exclude: "^tests/data"
3939
fail_fast: true
40-
default_stages: [commit]
40+
default_stages: [pre-commit]
4141
repos:
4242
- repo: local
4343
hooks:
@@ -62,6 +62,14 @@ repos:
6262
- isort
6363

6464

65+
- repo: https://github.com/pre-commit/pygrep-hooks
66+
rev: v1.10.0 # Use the ref you want to point at
67+
hooks:
68+
# Enforce that `# type: ignore` annotations always occur with specific codes.
69+
# Sample annotation: # type: ignore[attr-defined,name-defined]
70+
- id: python-check-blanket-type-ignore
71+
72+
6573
- repo: https://github.com/pre-commit/mirrors-mypy
6674
rev: v1.10.0
6775
hooks:
@@ -71,43 +79,43 @@ repos:
7179
- types-mock
7280
- types-six
7381
- types-toml
82+
- werkzeug
7483

7584

7685
- repo: https://github.com/rcmdnk/pyproject-pre-commit
7786
rev: v0.1.9
7887
hooks:
7988
- id: shellcheck
80-
- id: mdformat-check
81-
exclude: README-Unicode.md
82-
language: python
89+
90+
91+
- repo: https://github.com/igorshubovych/markdownlint-cli
92+
rev: v0.42.0
93+
hooks:
94+
- id: markdownlint
95+
96+
8397
- repo: https://github.com/pycqa/pylint
84-
rev: v2.17.4
98+
rev: v3.3.1
8599
hooks:
86100
- id: pylint
87101
args:
88102
[
89103
-sn, # Don't display the score
90104
--load-plugins=pylint.extensions.eq_without_hash,
91105
--ignore-imports=yes,
92-
"--disable=duplicate-code,line-too-long",
106+
"--disable=duplicate-code,line-too-long,import-error,no-name-in-module,c-extension-no-member",
93107
]
94108
log_file: ".git/pre-commit-pylint.log"
95109
additional_dependencies:
96-
- pyfakefs
97110
- six
98111
- mock
99112
- pandas
100113
- pytest_forked
101114
- toml
115+
116+
102117
- repo: local
103118
hooks:
104-
- id: run-pyre
105-
name: run-pyre (expect this to take 30 seconds)
106-
entry: python pyre_runner.py
107-
types: [python]
108-
language: python
109-
log_file: ".git/pre-commit-pyre.log"
110-
additional_dependencies: [pyre-check,mock]
111119
- id: pytype
112120
name: pytype (may take up to two minutes)
113121
entry: sh -c "pytype >/dev/tty"
@@ -121,17 +129,13 @@ repos:
121129
name: Check pytest unit tests pass
122130
types: [python]
123131
# entry: sh -c "pytest -x -rf --new-first --show-capture=all >/dev/tty"
124-
entry: sh -c "tox -e py38-covcombine >/dev/tty"
132+
entry: sh -c "tox >/dev/tty"
125133
verbose: true
126134
language: python
127135
require_serial: true
128136
pass_filenames: false
129-
- repo: https://github.com/pre-commit/pygrep-hooks
130-
rev: v1.10.0 # Use the ref you want to point at
131-
hooks:
132-
# Enforce that `# type: ignore` annotations always occur with specific codes.
133-
# Sample annotations: # type: ignore[attr-defined] # type: ignore[attr-defined,name-defined]
134-
- id: python-check-blanket-type-ignore
137+
138+
135139
- repo: https://github.com/pre-commit/pre-commit-hooks
136140
rev: v4.6.0
137141
hooks:

.vscode/ltex.dictionary.en-US.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ tokenless
2323
virtualenv
2424
virutalenv
2525
workdir
26+
xapi
27+
xensource

0 commit comments

Comments
 (0)