Skip to content

Commit 4b3d3e7

Browse files
committed
Add .pre-commit tooling
1 parent fc4eb46 commit 4b3d3e7

File tree

7 files changed

+81
-0
lines changed

7 files changed

+81
-0
lines changed

.codespellignore

Whitespace-only changes.

.codespellrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[codespell]
2+
skip =
3+
*.po,
4+
*.ts,
5+
tests/*
6+
count =
7+
quiet-level = 3
8+
ignore-words-list =
9+
cips

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# EditorConfig: https://EditorConfig.org. Provides sensible defaults for
2+
# non vscode editors.
3+
4+
# top-most EditorConfig file
5+
root = true
6+
7+
# Every file.
8+
[*]
9+
charset = utf-8
10+
end_of_line = lf
11+
insert_final_newline = true
12+
13+
indent_style = space
14+
indent_size = 4
15+
16+
trim_trailing_whitespace = true

.markdownlint.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
---
3+
default: true
4+
5+
# Exceptions, example given, MD045
6+
# MD045: false # allow image with no tag
7+
8+
# In-line HTML.
9+
MD033: false
10+
# Line lengths
11+
MD013:
12+
line_length: 80
13+
tables: false
14+
# First line in a file should be a top-level heading
15+
MD041: false

.markdownlintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
drafts/*

.pre-commit-config.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: check-yaml
6+
- id: check-json
7+
- id: check-toml
8+
- id: end-of-file-fixer
9+
exclude: ".svg"
10+
- id: trailing-whitespace
11+
- id: check-case-conflict
12+
- repo: https://github.com/igorshubovych/markdownlint-cli
13+
rev: v0.42.0
14+
hooks:
15+
- id: markdownlint
16+
- repo: https://github.com/codespell-project/codespell
17+
rev: v2.3.0
18+
hooks:
19+
- id: codespell
20+
args: [-I .codespellignore]

justfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
ROOT := `git rev-parse --show-toplevel`
2+
# Get help
3+
help:
4+
just -l
5+
6+
# (Re-)build the glossary
7+
build:
8+
node {{ROOT}}/builder/index.js --input {{ROOT}}/content > {{ROOT}}/docs/index.html
9+
10+
# Run all pre-commit checks
11+
all-checks:
12+
pre-commit run --all-files
13+
14+
# Run pre-commit spelling check
15+
spell:
16+
pre-commit run codespell --all-files
17+
18+
# Run pre-commit makdown-lint
19+
markdown:
20+
pre-commit run markdownlint --all-files

0 commit comments

Comments
 (0)