Skip to content

Commit d1e8aad

Browse files
committed
Add pre-commit config, incl. fixes
1 parent 34a003b commit d1e8aad

20 files changed

+626
-108
lines changed

.github/workflows/main.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ jobs:
9292
run: docker info
9393
- name: Script
9494
id: script
95+
# yamllint disable rule:indentation
96+
# yamllint disable rule:line-length
9597
run: |
9698
#! /usr/bin/env bash
9799
GITHUB_REF=${GITHUB_REF#refs/heads/}
@@ -174,6 +176,8 @@ jobs:
174176
echo "image=${TARGET_IMAGE}" >> "${GITHUB_OUTPUT}"
175177
echo -e "\e[35;1mtag=${IMAGE_TAG} >> \${GITHUB_OUTPUT}\e[0m"
176178
echo "tag=${IMAGE_TAG}" >> "${GITHUB_OUTPUT}"
179+
# yamllint enable rule:line-length
180+
# yamllint enable rule:indentation
177181
- name: Generate artifacts
178182
id: artifacts
179183
if: github.event_name != 'pull_request'
@@ -207,12 +211,16 @@ jobs:
207211
- uses: actions/download-artifact@v4
208212
- name: Read matrix output
209213
id: read
214+
# yamllint disable rule:line-length
210215
run: |
211216
result="$(find . -name ${{ needs.docker_generation_tue_env.outputs.key }} -exec cat {} \; | jq --slurp --raw-input 'split("\n")[:-1] | .[] | split(":") | {(.[0]) : [(.[1])]}' | jq -cs '[.[] | to_entries] | flatten | reduce .[] as $dot ({}; .[$dot.key] += $dot.value) | { ${{ needs.docker_generation_tue_env.outputs.key }} : . }' )"
212217
echo -e "\e[35;1mresult=${result} >> \${GITHUB_OUTPUT}\e[0m"
213-
echo "result=${result}" >> $GITHUB_OUTPUT
218+
echo "result=${result}" >> ${GITHUB_OUTPUT}
219+
# yamllint enable rule:line-length
214220
- name: Generate new manifest files
221+
# yamllint disable rule:indentation
215222
run: |
216223
ci/docker-manifest-generator.sh \
217224
--images-json='${{ toJSON(steps.read.outputs.result) }}' \
218225
--tag="${{ needs.docker_generation_tue_env.outputs.tag }}"
226+
# yamllint enable rule:indentation

.markdownlint.yaml

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

.pre-commit-config.yaml

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
ci:
2+
# autofix_commit_msg: |
3+
# [pre-commit.ci] auto fixes from pre-commit.com hooks
4+
#
5+
# for more information, see https://pre-commit.ci
6+
autofix_prs: false
7+
autoupdate_branch: ""
8+
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
9+
autoupdate_schedule: weekly
10+
skip: []
11+
submodules: false
12+
13+
repos:
14+
- repo: https://github.com/pre-commit/pre-commit-hooks
15+
rev: v5.0.0
16+
hooks:
17+
- id: check-added-large-files
18+
- id: check-ast
19+
- id: check-builtin-literals
20+
# - id: check-case-conflict
21+
- id: check-docstring-first
22+
- id: check-executables-have-shebangs
23+
# - id: check-illegal-windows-names
24+
- id: check-json
25+
- id: check-merge-conflict
26+
- id: check-shebang-scripts-are-executable
27+
exclude: '(^setup\.bash$|^setup/tue-data.bash$|^setup/tue-env.bash$|^setup/tue-functions.bash$|^setup/tue-misc.bash$)'
28+
- id: check-symlinks
29+
- id: check-toml
30+
- id: check-vcs-permalinks
31+
- id: check-xml
32+
- id: check-yaml
33+
- id: debug-statements
34+
- id: destroyed-symlinks
35+
# - id: detect-aws-credentials
36+
- id: detect-private-key
37+
# - id: double-quote-string-fixer
38+
- id: end-of-file-fixer
39+
# - id: file-contents-sorter
40+
# files: []
41+
- id: fix-byte-order-marker
42+
- id: fix-encoding-pragma
43+
args: [--remove]
44+
# - id: forbid-new-submodules
45+
# - id: forbid-submodules
46+
- id: mixed-line-ending
47+
args: ["--fix", "no"]
48+
# - id: name-tests-test
49+
# args: [
50+
# "--pytest-test-first" # test_.*\.py
51+
# # "--pytest" # .*_test\.py
52+
# # "--unittest" # test.*\.py
53+
# ]
54+
- id: no-commit-to-branch
55+
- id: pretty-format-json
56+
# - id: requirements-txt-fixer
57+
# - id: sort-simple-yaml
58+
# files: []
59+
- id: trailing-whitespace
60+
args: [--markdown-linebreak-ext=md]
61+
62+
- repo: https://github.com/psf/black
63+
rev: 24.10.0
64+
hooks:
65+
- id: black
66+
args: [--check, --diff, --color]
67+
68+
- repo: https://github.com/adrienverge/yamllint.git
69+
rev: v1.29.0
70+
hooks:
71+
- id: yamllint
72+
args: [--strict]
73+
74+
- repo: https://github.com/DavidAnson/markdownlint-cli2
75+
rev: v0.13.0
76+
hooks:
77+
- id: markdownlint-cli2
78+
args: ["--fix", "--config", ".markdownlint.yaml"]
79+
exclude: '^LICENSE.md$'
80+
81+
- repo: https://github.com/shellcheck-py/shellcheck-py
82+
rev: v0.10.0.1
83+
hooks:
84+
- id: shellcheck
85+
files: '\S\.(bash|sh)'
86+
87+
- repo: https://github.com/pre-commit-ci/pre-commit-ci-config
88+
rev: v1.6.1
89+
hooks:
90+
- id: check-pre-commit-ci-config

0 commit comments

Comments
 (0)