Skip to content

Commit 3a1946e

Browse files
update precommit markdownlint and add permissions on workflow files (#1246)
test out some precommit hooks and other updates --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent bfffd37 commit 3a1946e

File tree

6 files changed

+80
-50
lines changed

6 files changed

+80
-50
lines changed

.github/workflows/arm_mac_gcc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
branches:
55
- main
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
arm64_gcc:
912
name: ARM64 GCC

.github/workflows/pr_merged.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ on:
33
pull_request_target:
44
types: [closed]
55

6+
permissions:
7+
contents: write
8+
pull-request: write
9+
610
jobs:
711
label-merged:
812
name: Changelog needed

.pre-commit-config.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ repos:
1818
- id: check-symlinks
1919
- id: check-yaml
2020
- id: check-toml
21+
- id: check-json
2122
- id: end-of-file-fixer
2223
- id: mixed-line-ending
2324
- id: trailing-whitespace
25+
- id: check-illegal-windows-names
2426
- id: check-shebang-scripts-are-executable
2527
- id: check-executables-have-shebangs
2628
- id: debug-statements
@@ -37,19 +39,21 @@ repos:
3739
- id: cmake-format
3840
additional_dependencies: [pyyaml]
3941

40-
- repo: https://github.com/pre-commit/mirrors-prettier
41-
rev: "v4.0.0-alpha.8"
42+
- repo: https://github.com/JoC0de/pre-commit-prettier
43+
rev: v3.6.2
4244
hooks:
4345
- id: prettier
4446
types_or: [yaml, markdown, html, css, scss, javascript, json]
4547
args: [--prose-wrap=always]
46-
47-
- repo: https://github.com/markdownlint/markdownlint
48-
rev: v0.13.0
48+
- repo: https://github.com/jumanjihouse/pre-commit-hooks
49+
rev: 3.0.0
4950
hooks:
50-
- id: markdownlint
51-
args: [-s, ./scripts/.markdownlintrc]
52-
51+
- id: script-must-have-extension
52+
- repo: https://github.com/DavidAnson/markdownlint-cli2
53+
rev: v0.12.0 # Use the latest stable version
54+
hooks:
55+
- id: markdownlint-cli2
56+
args: ["--fix", "--config", "./scripts/.markdownlint-cli2.jsonc"] # Optional: specify a custom config file
5357
# - repo: local
5458
# hooks:
5559
# - id: remarklint

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1992,7 +1992,6 @@ try! Feedback is always welcome.
19921992
https://app.codacy.com/project/badge/Grade/2796b969c1b54321a02ad08affec0800
19931993
[codacy-link]:
19941994
https://www.codacy.com/gh/CLIUtils/CLI11/dashboard?utm_source=github.com&utm_medium=referral&utm_content=CLIUtils/CLI11&utm_campaign=Badge_Grade
1995-
[hunter]: https://docs.hunter.sh/en/latest/packages/pkg/CLI11.html
19961995
[standard readme style]: https://github.com/RichardLitt/standard-readme
19971996
[argparse]: https://github.com/p-ranav/argparse
19981997
[toml]: https://toml.io

scripts/.markdownlint-cli2.jsonc

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"config": {
3+
"MD001": true, // header levels increment by 1
4+
"MD002": true, // first header should be a top level header
5+
"MD003": { "style": "atx" }, // header style
6+
"MD004": { "style": "dash" }, // unordered list style - dash
7+
// "MD005": false, // inconsistent indentation handled by prettier
8+
"MD006": true, // bulleted lists at beginning of line
9+
// "MD007": { "indent": 2 }, // handled by prettier
10+
"MD009": true, // no trailing spaces
11+
"MD010": true, // no hard tabs
12+
"MD011": true, // reversed link syntax
13+
"MD012": true, // multiple consecutive blank lines
14+
"MD013": false, // line length ignored
15+
// "MD014": false, // command syntax ignored
16+
"MD018": true, // space after header style
17+
"MD019": true, // no multiple spaces after header style
18+
"MD020": true, // no spaces inside hashes
19+
"MD021": true, // no spaces inside closing hashes
20+
"MD022": true, // headers surrounded by blank lines
21+
"MD023": true, // headers start at beginning of line
22+
"MD024": { "siblings_only": true,"allow_different_nesting": true }, // duplicate headers allowed in different nests
23+
"MD025": true, // only one H1
24+
"MD026": { "punctuation": ".,;:" }, // no trailing punctuation
25+
"MD027": true, // multiple spaces after blockquote
26+
"MD028": true, // no blank lines inside blockquote
27+
// "MD029": { "style": "ordered" }, // prettier handles numbering
28+
// "MD030": { "ul_single": 1, "ol_single": 1, "ul_multi": 1, "ol_multi": 3 }, // prettier handles spacing
29+
"MD031": true, // fenced code blocks surrounded by blank lines
30+
// "MD032": false, // lists surrounded by blank lines, prettier handles
31+
// "MD033": { "allowed_elements": "a, em, strong, code, del, ins, sup, sub" }, // inline HTML exceptions
32+
"MD033": false,
33+
// "MD034": false, // raw URLs allowed
34+
"MD035": { "style": "---" }, // horizontal rule style
35+
// "MD036": false, // strong vs emphasis ignored
36+
"MD037": true, // no spaces inside emphasis
37+
"MD038": true, // no spaces inside code spans
38+
"MD039": true, // no spaces inside link text
39+
"MD040": true, // require fenced language
40+
"MD041": true, // first line is top-level header
41+
// "MD042": false, // empty link disabled
42+
"MD046": { "style": "fenced" }, // code block style
43+
"MD047": true, // single newline at end
44+
"MD048": true, // code fence style consistency ignored
45+
// Newly enabled rules for testing:
46+
"MD044": {
47+
// proper names; empty list means default names only
48+
"names": []
49+
},
50+
"MD049": { "style": "consistent" }, // emphasis style
51+
"MD050": { "style": "consistent" }, // strong style
52+
"MD051": true, // valid link fragments
53+
"MD052": true, // reference links/images must use defined labels
54+
"MD053": true, // flag unused or undefined link references
55+
56+
// Table-related rules: enable if you use tables
57+
"MD055": true, // consistent pipe style
58+
"MD056": true, // consistent column counts
59+
"MD058": true // blank lines around tables
60+
}
61+
}

scripts/.markdownlintrc

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)