Skip to content

feat: add reusable multi-language style-check workflow - #17

Open
TheMeinerLP wants to merge 2 commits into
mainfrom
feat/style-check-workflow
Open

feat: add reusable multi-language style-check workflow#17
TheMeinerLP wants to merge 2 commits into
mainfrom
feat/style-check-workflow

Conversation

@TheMeinerLP

@TheMeinerLP TheMeinerLP commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Adds a reusable style-check.yml that offers style/formatting checks for several languages in one workflow.

Design

  • One job per language, each gated by a dorny/paths-filter — a job only runs when files for that language changed (e.g. a Gradle repo runs just Spotless, a Dart repo just the Dart job).
  • Non-mutating: every tool runs in check/verify mode and never writes changes back.
  • Toggleable: each language has a boolean input (default true); force: true ignores the path filters.
  • Follows the existing repo conventions (repository-owner guard, concurrency, workflow_call, pinned actions). Validated with actionlint.

Languages & tools (chosen to match what repos already use)

Language Check
Java/Kotlin ./gradlew spotlessCheckauto-skips if the task doesn't exist, so non-Spotless repos don't fail
Rust cargo fmt --all --check (+ optional clippy -D warnings)
Dart dart format --set-exit-if-changed (+ optional dart analyze)
JS/TS npm run lint if a lint script exists, else prettier --check (override via javascript-command)
Python ruff check + ruff format --check (override via python-command)
Shell shellcheck over tracked *.sh/*.bash/*.zsh (severity configurable)
YAML yamllint with repo-local .yamllint* config, else the relaxed ruleset
EditorConfig language-agnostic baseline via editorconfig-checker

Usage

jobs:
  style:
    uses: OneLiteFeatherNET/workflows/.github/workflows/style-check.yml@v2

No secrets required. README updated with table entry + usage examples.

🤖 Generated with Claude Code

TheMeinerLP and others added 2 commits July 3, 2026 12:32
Adds .github/workflows/style-check.yml offering per-language style/format
checks that auto-skip when a language's files did not change, are individually
toggleable, and run strictly in check mode (never mutate):

- Java/Kotlin: gradlew spotlessCheck (auto-skips if task absent)
- Rust: cargo fmt --check (+ optional clippy)
- Dart: dart format --set-exit-if-changed (+ optional analyze)
- JavaScript/TypeScript: npm run lint if present, else prettier --check
- Python: ruff check + ruff format --check
- EditorConfig: language-agnostic baseline

Documented in README with usage examples.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Shell: shellcheck over tracked *.sh/*.bash/*.zsh (configurable severity)
- YAML: yamllint using repo-local .yamllint* config, else the relaxed ruleset
Both auto-skip when unchanged, are toggleable, and run in check mode only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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