Skip to content

Commit 64fe154

Browse files
authored
Merge pull request #9 from zarhus/add-pre-commit
pre-commit: add pre-commit
2 parents 247161a + 016553b commit 64fe154

14 files changed

+346
-54
lines changed

.codespellrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[codespell]
2+
exclude-file = .codespellx
3+
ignore-words-list = FPT,FTP,fpt,ftp,SoM

.codespellx

Whitespace-only changes.

.conform.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
policies:
3+
- type: commit
4+
spec:
5+
header:
6+
length: 80
7+
imperative: false
8+
invalidLastCharacters: .
9+
body:
10+
required: false
11+
dco: true
12+
gpg:
13+
required: true
14+
spellcheck:
15+
locale: US
16+
maximumOfOneCommit: false

.lycheeignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
https://fosstodon.org/@TBD
2+
https://twitter.com/TBD
3+
https://www.reddit.com/r/TBD

.markdownlint.yaml

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
---
2+
# Documentation:
3+
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
4+
5+
# Default state for all rules
6+
default: false
7+
8+
# MD001/heading-increment/header-increment - Heading levels should only increment by one level at a time
9+
MD001: true
10+
11+
# MD002/first-heading-h1/first-header-h1 - First heading should be a top-level heading
12+
MD002:
13+
# Heading level
14+
level: 1
15+
16+
# MD003/heading-style/header-style - Heading style
17+
18+
MD003:
19+
# Heading style
20+
# # ATX style H1
21+
style: "atx"
22+
23+
# MD004/ul-style - Unordered list style
24+
MD004:
25+
# List style
26+
style: "sublist"
27+
28+
# MD005/list-indent - Inconsistent indentation for list items at the same level
29+
MD005: true
30+
31+
# MD006/ul-start-left - Consider starting bulleted lists at the beginning of the line
32+
MD006: true
33+
34+
# MD007/ul-indent - Unordered list indentation
35+
MD007:
36+
# Spaces for indent
37+
indent: 4
38+
# Whether to indent the first level of the list
39+
start_indented: false
40+
41+
# MD009/no-trailing-spaces - Trailing spaces
42+
MD009:
43+
# Spaces for line break
44+
br_spaces: 2
45+
# Allow spaces for empty lines in list items
46+
list_item_empty_lines: false
47+
# Include unnecessary breaks
48+
strict: false
49+
50+
# MD010/no-hard-tabs - Hard tabs
51+
MD010:
52+
# Include code blocks
53+
code_blocks: false
54+
# Number of spaces for each hard tab
55+
spaces_per_tab: 1
56+
57+
# MD011/no-reversed-links - Reversed link syntax
58+
MD011: true
59+
60+
# MD012/no-multiple-blanks - Multiple consecutive blank lines
61+
MD012:
62+
# Consecutive blank lines
63+
maximum: 1
64+
# MD013/line-length - Line length
65+
#
66+
MD013:
67+
# Number of characters
68+
line_length: 80
69+
# Number of characters for headings
70+
heading_line_length: 80
71+
# Number of characters for code blocks
72+
code_block_line_length: 160
73+
# Include code blocks
74+
code_blocks: false
75+
# Include tables
76+
tables: false
77+
# Include headings
78+
headings: true
79+
# Strict length checking (e.g. allow for longer URLs)
80+
strict: false
81+
# Stern length checking
82+
stern: false
83+
84+
# MD014/commands-show-output - Dollar signs used before commands without showing output
85+
# TODO: set false for now but we should consider enabling it
86+
# https://cirosantilli.com/markdown-style-guide#dollar-signs-in-shell-code
87+
MD014: false
88+
89+
# MD018/no-missing-space-atx - No space after hash on atx style heading
90+
MD018: true
91+
92+
# MD019/no-multiple-space-atx - Multiple spaces after hash on atx style heading
93+
MD019: true
94+
95+
# MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines
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/header-start-left - Headings must start at the beginning of the line
103+
MD023: true
104+
105+
# MD025/single-title/single-h1 - Multiple top-level headings in the same document
106+
# TODO: consider enabling it
107+
108+
# MD026/no-trailing-punctuation - Trailing punctuation in heading
109+
MD026:
110+
# Punctuation characters
111+
punctuation: ".,;:!。,;:!"
112+
113+
# MD027/no-multiple-space-blockquote - Multiple spaces after blockquote symbol
114+
MD027: true
115+
116+
# MD028/no-blanks-blockquote - Blank line inside blockquote
117+
MD028: true
118+
119+
# MD029/ol-prefix - Ordered list item prefix
120+
MD029:
121+
# List style
122+
style: "one_or_ordered"
123+
124+
# MD030/list-marker-space - Spaces after list markers
125+
MD030:
126+
# Spaces for single-line unordered list items
127+
ul_single: 1
128+
# Spaces for single-line ordered list items
129+
ol_single: 1
130+
# Spaces for multi-line unordered list items
131+
ul_multi: 1
132+
# Spaces for multi-line ordered list items
133+
ol_multi: 1
134+
135+
# MD031/blanks-around-fences - Fenced code blocks should be surrounded by blank lines
136+
MD031:
137+
# Include list items
138+
list_items: true
139+
140+
# # MD033/no-inline-html - Inline HTML
141+
# MD033:
142+
# # Allowed elements
143+
# allowed_elements: ["br", "center", "img", "script", "form", "input"]
144+
145+
# MD034/no-bare-urls - Bare URL used
146+
MD034: true
147+
148+
# MD035/hr-style - Horizontal rule style
149+
MD035:
150+
# Horizontal rule style
151+
style: "---"
152+
153+
# MD037/no-space-in-emphasis - Spaces inside emphasis markers
154+
MD037: true
155+
156+
# MD038/no-space-in-code - Spaces inside code span elements
157+
MD038: true
158+
159+
# MD039/no-space-in-links - Spaces inside link text
160+
MD039: true
161+
162+
# MD040/fenced-code-language - Fenced code blocks should have a language specified
163+
MD040: true
164+
165+
# MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading
166+
MD041:
167+
# Heading level
168+
level: 1
169+
# RegExp for matching title in front matter
170+
front_matter_title: "^\\s*title\\s*[:=]"
171+
172+
# MD042/no-empty-links - No empty links
173+
MD042: true
174+
175+
# # MD046/code-block-style - Code block style
176+
# MD046:
177+
# # Block style
178+
# style: "fenced"
179+
180+
# MD047/single-trailing-newline - Files should end with a single newline character
181+
MD047: true
182+
183+
# MD048/code-fence-style - Code fence style
184+
MD048:
185+
# Code fence style
186+
style: "backtick"
187+
188+
# MD049/emphasis-style - Emphasis style should be consistent
189+
MD049:
190+
# Emphasis style should be consistent
191+
style: "underscore"
192+
193+
# MD050/strong-style - Strong style should be consistent
194+
MD050:
195+
# Strong style should be consistent
196+
style: "asterisk"

.pre-commit-config.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
default_stages: [pre-commit]
3+
4+
default_install_hook_types: [pre-commit, commit-msg]
5+
6+
exclude: (^vendor/|.*\.pdf|.*\.svg$)
7+
8+
ci:
9+
autoupdate_commit_msg: 'pre-commit: autoupdate hooks'
10+
autofix_prs: false
11+
# docker is not supported on pre-commit.ci
12+
skip: [shellcheck]
13+
14+
repos:
15+
- repo: https://github.com/pre-commit/pre-commit-hooks
16+
rev: v4.6.0
17+
hooks:
18+
- id: check-added-large-files
19+
- id: check-merge-conflict
20+
- id: check-symlinks
21+
- id: detect-private-key
22+
- id: end-of-file-fixer
23+
- id: trailing-whitespace
24+
exclude: ^.*\.patch$
25+
- id: mixed-line-ending
26+
exclude: ^.*\.patch$
27+
28+
- repo: https://github.com/talos-systems/conform
29+
rev: v0.1.0-alpha.30
30+
hooks:
31+
- id: conform
32+
stages:
33+
- commit-msg
34+
35+
- repo: https://github.com/codespell-project/codespell
36+
rev: v2.3.0
37+
hooks:
38+
- id: codespell
39+
40+
- repo: https://github.com/adrienverge/yamllint
41+
rev: v1.35.1
42+
hooks:
43+
- id: yamllint
44+
args: [-c=.yamllint]
45+
46+
- repo: https://github.com/igorshubovych/markdownlint-cli
47+
rev: v0.41.0
48+
hooks:
49+
- id: markdownlint
50+
- id: markdownlint-fix
51+
52+
- repo: https://github.com/lycheeverse/lychee
53+
rev: v0.15.1
54+
hooks:
55+
- id: lychee-docker
56+
# Optionally include additional CLI arguments
57+
args: [
58+
"--no-progress", "--exclude", "file://", "--exclude", "0.0.0.0",
59+
"--exclude", ".git", "--timeout", "10",
60+
"--exclude-all-private", "-m", "10", "-q"
61+
]

.yamllint

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
extends: default
3+
4+
rules:
5+
comments:
6+
require-starting-space: true
7+
ignore-shebangs: true
8+
min-spaces-from-content: 2
9+
document-start:
10+
present: true
11+
level: error
12+
indentation:
13+
spaces: 2
14+
line-length: disable
15+
truthy:
16+
check-keys: false

README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,29 +56,26 @@ mkdocs.yml)
5656

5757
There should be no TBD or TODO visible on the website.
5858

59-
<!--
6059
### pre-commit hooks
6160

6261
- [Install pre-commit](https://pre-commit.com/index.html#install), if you
6362
followed [local build](#local-build) procedure `pre-commit` should be
6463
installed
6564

66-
- [Install go](https://go.dev/doc/install)
67-
6865
- Install hooks into repo:
6966

70-
```shell
71-
pre-commit install
72-
```
67+
```shell
68+
pre-commit install
69+
```
7370

7471
- Enjoy automatic checks on each `git commit` action!
7572

7673
- (Optional) Run hooks on all files (for example, when adding new hooks or
7774
configuring existing ones):
7875

79-
```shell
80-
pre-commit run --all-files
81-
```
76+
```shell
77+
pre-commit run --all-files
78+
```
8279

8380
#### To skip verification
8481

@@ -88,11 +85,10 @@ use:
8885
```shell
8986
git commit --no-verify
9087
```
91-
-->
9288

9389
### Embedding videos
9490

9591
Embedding videos with in-line HTML `iframe` tag does not work.
9692
[mkdocs-video](https://github.com/soulless-viewer/mkdocs-video) plugin is used
9793
instead. To embed an video simply type the following in markdown:
98-
`![type:video](https://www.youtube.com/embed/LXb3EKWsInQ)` (example).
94+
`![type:video](https://www.youtube.com/embed/LXb3EKWsInQ)` (example).

docs/CNAME

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
docs.zarhus.com
1+
docs.zarhus.com

docs/guides/managing-layers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Currently, we use following custom layers:
3131
+----------+----------------+ +---------+-----------------+
3232
| | | |
3333
| BSP layers | | Software layers |
34-
| (hardware depended) | | (hardware independed) |
34+
| (hardware dependent) | | (hardware independent) |
3535
| | | |
3636
| +------------------------+| | +------------+ |
3737
| |meta-zarhus-bsp-rockchip|| | | meta-zarhus| |

0 commit comments

Comments
 (0)