Skip to content

Commit 8f39569

Browse files
committed
demo generation
1 parent 4083e38 commit 8f39569

File tree

4 files changed

+48
-9
lines changed

4 files changed

+48
-9
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
screenshots
2+
13
# Logs
24
logs
35
*.log

.trunk/trunk.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,16 @@ lint:
5353
# - todo-grep-linter
5454
- todo-grep-wrapped
5555
paths:
56-
- plugin.yaml
57-
- todo_grep.sh
58-
- .trunk/trunk.yaml
59-
- README.md
6056
- cspell.yaml
6157
- .codespellrc
62-
- todo_dict.txt
63-
- .vale.ini
64-
- styles/**
58+
- generate_demo.sh
59+
- .markdownlint.json
60+
- plugin.yaml
61+
- README.md
6562
- .semgrep.yaml
63+
- styles/**
64+
- todo_dict.txt
65+
- todo_grep.sh
6666
- toolbox.toml
67-
- .markdownlint.json
67+
- .trunk/trunk.yaml
68+
- .vale.ini

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ trunk check --filter=markdownlint test_data.md
3939
To run outside Trunk, run:
4040

4141
```bash
42-
.trunk/tools/markdownlint test_data.md
42+
.trunk/tools/markdownlint -r markdownlint-rule-search-replace test_data.md
4343
```
4444

4545
## CSpell

generate_demo.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
function freeze_linter() {
6+
freeze --theme=dracula -o "${2}" --execute "bash -c 'echo $ ${1}; ${1} || true'"
7+
}
8+
9+
function freeze_trunk() {
10+
freeze --theme=dracula -o "${2/tb/trunk}" --execute "bash -c '${1} --no-progress --show-existing'"
11+
}
12+
13+
mkdir -p screenshots
14+
15+
# Requires a pre-release version of Trunk
16+
tb=../trunk/bazel-bin/trunk/cli/cli
17+
freeze_trunk "${tb} check --filter=markdownlint test_data.md" "screenshots/markdownlint_trunk.png"
18+
freeze_linter ".trunk/tools/markdownlint -r markdownlint-rule-search-replace test_data.md" "screenshots/markdownlint.png"
19+
20+
freeze_trunk "trunk check --filter=cspell test_data.md" "screenshots/cspell_trunk.png"
21+
freeze_linter ".trunk/tools/cspell --no-summary test_data.md" "screenshots/cspell.png"
22+
23+
freeze_trunk "trunk check --filter=codespell test_data.md" "screenshots/codespell_trunk.png"
24+
freeze_linter ".trunk/tools/codespell test_data.md" "screenshots/codespell.png"
25+
26+
freeze_trunk "trunk check --filter=vale test_data.md" "screenshots/vale_trunk.png"
27+
freeze_linter ".trunk/tools/vale --output=line test_data.md" "screenshots/vale.png"
28+
29+
freeze_trunk "trunk check --filter=semgrep test_data.md" "screenshots/semgrep_trunk.png"
30+
freeze_linter ".trunk/tools/semgrep --config=auto --config=.semgrep.yaml -q --include=test_data.md" "screenshots/semgrep.png"
31+
32+
freeze_trunk "trunk check --filter=trunk-toolbox test_data.md" "screenshots/toolbox_trunk.png"
33+
freeze_linter ".trunk/tools/trunk-toolbox --output-format=text test_data.md" "screenshots/toolbox.png"
34+
35+
freeze_trunk "trunk check --filter=todo-grep-wrapped test_data.md" "screenshots/grep_trunk.png"
36+
freeze_linter "./todo_grep.sh test_data.md" "screenshots/grep.png"

0 commit comments

Comments
 (0)