Skip to content

feat(linting): add pre-commit reusable workflow#98

Merged
patrick-hermann-sva merged 1 commit into
mainfrom
feat/pre-commit
May 28, 2026
Merged

feat(linting): add pre-commit reusable workflow#98
patrick-hermann-sva merged 1 commit into
mainfrom
feat/pre-commit

Conversation

@patrick-hermann-sva
Copy link
Copy Markdown
Contributor

Summary

  • New call-pre-commit.yaml reusable wrapping github.com/stuttgart-things/dagger/linting@v0.115.0 run-pre-commit. Callers point at a repo + .pre-commit-config.yaml and the dagger module supplies the Python/pre-commit/hook environments inside its container.
  • Findings file is exported to the runner, printed to the log, uploaded as an artifact, and added to the run's step summary.
  • Because the dagger function captures pre-commit's output with || true (always exits 0), the reusable inspects the text and fails when any line ends in ...Failed. A continue-on-error input flips this to advisory mode.
  • Inputs cover the usual knobs: src, config-path, skip-hooks, output-file, dagger-version, linting-module-version, artifact-retention-days, runs-on, environment-name.

First consumer is stuttgart-things/crossplane-configurations (consumer PR to follow once this merges).

Test plan

  • Smoke-tested locally end-to-end against crossplane-configurations via task pre-commit (same dagger module + function + args).
  • Open consumer PR in stuttgart-things/crossplane-configurations once this is on main.
  • Confirm the reusable's Pre-commit Hooks job ✓s in CI with all repo hooks passing.

🤖 Generated with Claude Code

Wraps github.com/stuttgart-things/dagger/linting@v0.115.0 `run-pre-commit`,
so callers don't need Python / pre-commit / hook environments on the
runner. Findings are exported to a file, displayed in the log, attached
as an artifact, and added to the GitHub step summary.

The dagger function masks pre-commit's real exit code with `|| true`, so
the reusable inspects the captured text and fails when any hook line
ends in `...Failed`. A `continue-on-error` input flips this to advisory.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@patrick-hermann-sva patrick-hermann-sva merged commit 1a09984 into main May 28, 2026
1 check passed
@patrick-hermann-sva patrick-hermann-sva deleted the feat/pre-commit branch May 28, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant