ci: add pre-commit hooks and workflow#392
Open
dannf wants to merge 14 commits into
Open
Conversation
80b67d4 to
f4649fe
Compare
Add missing final newlines to Makefiles to comply with POSIX text file requirements. Detected by pre-commit end-of-file-fixer hook. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
Add missing final newlines to comply with POSIX text file requirements. Detected by pre-commit end-of-file-fixer hook. Files fixed: - tests/README.md - tests/runner/go.mod - tw/testdata/dgrep.txtar 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
Add missing blank line at end of file to comply with yam formatting standards. Detected by pre-commit yam hook. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
Add pre-commit hooks to catch linting issues before commit: - YAML formatting (yam) - YAML syntax validation - Shellcheck for shell scripts - Standard pre-commit checks (merge conflicts, large files, etc.) This catches the same issues that would fail in CI, providing faster feedback to developers during local development. To use: pip install pre-commit pre-commit install 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
Add automated pre-commit check workflow that runs on PRs and pushes to main. Uses caching to optimize performance - runs full check when config changes, otherwise only checks modified files for faster feedback. This ensures all commits meet linting standards before merge. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
2cfdf03 to
7c57f60
Compare
Configure markdownlint to allow 120-character lines instead of the default 80. This permits table content and other documentation to remain unmodified while still passing markdown linting checks. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
Add markdownlint-cli2 hook to ensure markdown files pass stereo's markdownlint checks when synced. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
Run markdownlint-cli2 with --fix to automatically resolve fixable markdown linting issues. This fixes 52 out of 104 total errors. Errors fixed include: - MD022/blanks-around-headings: Add blank lines around headings - MD014/commands-show-output: Remove $ from command examples - MD032/blanks-around-lists: Add blank lines around lists - MD004/ul-style: Convert asterisk lists to dash style - MD031/blanks-around-fences: Add blank lines around code blocks - MD029/ol-prefix: Fix ordered list numbering - MD038/no-space-in-code: Remove spaces in code spans Remaining 52 errors require manual fixes: - MD013/line-length: Lines exceeding 120 characters - MD046/code-block-style: Fenced blocks where indented expected - MD040/fenced-code-language: Code blocks missing language specifier - MD060/table-column-style: Table alignment issues 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
Add appropriate language specifiers to all fenced code blocks: - `console` for command-line output examples - `yaml` for YAML-formatted output - `text` for directory structure diagrams Fixes markdownlint MD040/fenced-code-language errors: README.md:104 error MD040/fenced-code-language tests/README.md:7 error MD040/fenced-code-language tests/runner/README.md:129 error MD040/fenced-code-language tests/runner/README.md:197 error MD040/fenced-code-language tests/runner/README.md:261 error MD040/fenced-code-language tests/runner/README.md:284 error MD040/fenced-code-language tests/runner/README.md:331 error MD040/fenced-code-language tw/pkg/commands/shelldeps/README.md:67 error MD040/fenced-code-language tw/pkg/commands/shelldeps/README.md:75 error MD040/fenced-code-language tw/pkg/commands/shelldeps/README.md:173 error MD040/fenced-code-language tw/pkg/commands/shelldeps/README.md:245 error MD040/fenced-code-language tw/pkg/commands/shelldeps/README.md:371 error MD040/fenced-code-language 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
Configure markdownlint to prefer fenced code blocks over indented blocks and convert remaining indented blocks to fenced format with language specifiers. Changes: - Set MD046 style to "fenced" in .markdownlint-cli2.yaml - Convert indented code blocks to fenced in README.md - Convert indented code block to fenced in usrmerge-tool/README.md Fenced blocks provide better syntax highlighting and are more explicit about the code language. Fixes markdownlint MD046/code-block-style errors: README.md:10 error MD046/code-block-style usrmerge-tool/README.md:9 error MD046/code-block-style 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
Configure markdownlint to use compact table style and fix table separator formatting in tests/README.md. Changes: - Set MD060 style to "compact" in .markdownlint-cli2.yaml - Fix table separator in tests/README.md to use compact style with spaces Compact style is more practical for tables with varying column widths. Fixes markdownlint MD060/table-column-style errors: tests/README.md:118 (6 errors) - table separator formatting 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
Convert the GNU-only flags table in shelldeps README from aligned to compact style by removing extra spacing. Compact style is more maintainable for tables with varying column widths and doesn't require alignment padding. Fixes markdownlint MD060/table-column-style errors: tw/pkg/commands/shelldeps/README.md:325-345 (40 errors) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
Wrapped long lines to comply with the 120 character line length limit configured in .markdownlint-cli2.yaml. Files modified: - tests/README.md: wrapped lines 31, 59, 61 - tests/runner/README.md: wrapped lines 3, 7, 149, 150, 386 - tw/pkg/commands/shelldeps/README.md: wrapped lines 3, 16, 93, 150, 285, 298, 306, 307, 321, 349, 377, 432, 447 - header-check/README.md: wrapped line 5 - syspeek-tool/README.md: wrapped lines 5, 7, 59, 61 Markdownlint output after fixes: markdownlint-cli2 v0.22.1 (markdownlint v0.40.0) Finding: **/*.md Linting: 16 file(s) Summary: 0 error(s) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
Dependabot now automatically discovers all modules from go.work (as of v0.374.0, merged in PR #14909). This eliminates the need to manually enumerate module directories and ensures go.work is updated alongside go.mod files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Add pre-commit infrastructure to catch linting issues before commit and in CI:
yamWhy
stereobecause the documented release process will try to syncINDEX.mdinto stereo, which has this check. Note: I don't thinkstereoshould be enforcing formatting on things for which it is not the upstream, so I also opened https://github.com/chainguard-dev/stereo/pull/122645. But if we thinkmarkdownlintis generally a good lint, we might as well also do it fortwfor consistency.