-
Notifications
You must be signed in to change notification settings - Fork 98
/
Justfile
63 lines (49 loc) · 1.84 KB
/
Justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
set positional-arguments
# default recipe to display help information
default:
@just --list
# Install required dependencies
deps:
cargo install mdbook mdbook-katex mdbook-linkcheck mdbook-mermaid
pnpm i --frozen-lockfile
# Lint the workspace for all available targets
lint: lint-specs-md-check lint-specs-toc-check lint-filenames lint-links lint-specs-spelling
# Updates all files to fix linting issues
lint-fix: lint-specs-md-fix lint-specs-toc
# Validates markdown file formatting
lint-specs-md-check:
npx markdownlint-cli2 "./specs/**/*.md"
# Updates markdown files formatting to satisfy lints
lint-specs-md-fix:
npx markdownlint-cli2 --fix "./specs/**/*.md"
# Validates Table of Content Sections with doctoc
lint-specs-toc-check:
npx doctoc '--title=**Table of Contents**' ./specs && git diff --exit-code ./specs
# Updates Table of Content Sections with doctoc
lint-specs-toc:
npx doctoc '--title=**Table of Contents**' ./specs
# Validates all hyperlinks respond with status 200
lint-links:
docker run --init -it -v `pwd`:/input lycheeverse/lychee --verbose --no-progress --exclude-loopback \
--exclude twitter.com --exclude explorer.optimism.io --exclude linux-mips.org --exclude vitalik.eth.limo \
--exclude-mail /input/README.md "/input/specs/**/*.md"
# Validates spelling using cspell
lint-specs-spelling:
npx cspell "./**/*.md"
# Updates cspell words file with new words
lint-specs-spelling-fix:
npx cspell --words-only --unique "./**/*.md" | sort --ignore-case | uniq > words.txt
lint-filenames:
#!/usr/bin/env bash
for file in $(find ./specs -type f); do
if [[ "$file" == *_* ]]; then
echo "File with underscore found: $file"
exit 1
fi
done
echo "Filename linting complete"
build:
mdbook build
# Serves the mdbook locally
serve *args='':
mdbook serve $@