Repository navigation
chore: add pre-commit hooks (file hygiene, secrets, markdown, rust, commits) #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
141c5c3
chore: add pre-commit hooks (file hygiene, secrets, markdown, rust, c…
herata f57ff3c
fix(pre-commit): route cargo hooks through mise + ignore internal docs
herata 7a40dc7
chore(pre-commit): autoupdate hook revs and disable MD060 for CJK tables
herata 438cd0b
fix(ci): route test job cargo + rustup through mise exec
herata c4010c6
fix(ci): use dtolnay toolchain for test matrix, route pre-commit rust…
herata File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # markdownlint-cli2 config for slack-cli. | ||
| # Mainly relaxes rules that fight against Japanese line widths and | ||
| # legitimate inline HTML / bare URLs in README content. | ||
|
|
||
| config: | ||
| line-length: false | ||
| no-inline-html: false | ||
| no-bare-urls: false | ||
| first-line-h1: false | ||
| no-duplicate-heading: false | ||
| no-emphasis-as-heading: false | ||
| # Tables with mixed-width (CJK + ASCII) characters cannot be aligned by | ||
| # column at the byte/code-point level. Keep tables readable by content, | ||
| # not by pipe alignment. | ||
| table-column-style: false | ||
|
|
||
| ignores: | ||
| - 'CHANGELOG.md' | ||
| - 'target/**' | ||
| # Internal brainstorming spec + implementation plan, kept as-is. | ||
| - 'docs/superpowers/**' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # pre-commit hooks for slack-cli. | ||
| # | ||
| # Install (one-time, per clone): | ||
| # pip install --user pre-commit # or: brew install pre-commit, pipx install pre-commit | ||
| # pre-commit install | ||
| # pre-commit install --hook-type commit-msg | ||
| # | ||
| # Run manually on every tracked file: | ||
| # pre-commit run --all-files | ||
|
|
||
| repos: | ||
| # ----- File hygiene ----- | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v6.0.0 | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| exclude: '\.snap$' | ||
| - id: end-of-file-fixer | ||
| exclude: '\.snap$' | ||
| - id: check-yaml | ||
| - id: check-toml | ||
| - id: check-json | ||
| - id: check-merge-conflict | ||
| - id: check-added-large-files | ||
| args: [--maxkb=1024] | ||
| - id: mixed-line-ending | ||
| args: [--fix=lf] | ||
| - id: detect-private-key | ||
|
|
||
| # ----- Secret detection ----- | ||
| - repo: https://github.com/gitleaks/gitleaks | ||
| rev: v8.30.0 | ||
| hooks: | ||
| - id: gitleaks | ||
|
|
||
| # ----- Markdown lint ----- | ||
| - repo: https://github.com/DavidAnson/markdownlint-cli2 | ||
| rev: v0.22.1 | ||
| hooks: | ||
| - id: markdownlint-cli2 | ||
| args: ['--config', '.markdownlint-cli2.yaml'] | ||
|
|
||
| # ----- Conventional Commits (commit-msg only) ----- | ||
| - repo: https://github.com/compilerla/conventional-pre-commit | ||
| rev: v4.4.0 | ||
| hooks: | ||
| - id: conventional-pre-commit | ||
| stages: [commit-msg] | ||
| args: [feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert] | ||
|
|
||
| # ----- Rust (local hooks via mise so the toolchain is always pinned) ----- | ||
| - repo: local | ||
| hooks: | ||
| - id: cargo-fmt | ||
| name: cargo fmt --check | ||
| entry: mise exec -- cargo fmt --all -- --check | ||
| language: system | ||
| types: [rust] | ||
| pass_filenames: false | ||
| - id: cargo-clippy | ||
| name: cargo clippy --all-targets -- -D warnings | ||
| entry: mise exec -- cargo clippy --all-targets -- -D warnings | ||
| language: system | ||
| types: [rust] | ||
| pass_filenames: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.