-
Notifications
You must be signed in to change notification settings - Fork 456
feat(ci,tooling): improve static check developer experience #2099
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
Changes from all commits
9840c1d
3361a33
c89a017
db48101
daca85b
e59d99f
e3fdd4d
40d4fb9
6cc0385
b669a88
38b593f
c309c56
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| name: Check | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
| workflow_dispatch: | ||
| workflow_call: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| checks: | ||
| name: ${{ matrix.name }} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - { name: "Spellcheck", tox-env: spellcheck } | ||
| - { name: "Python Lint", tox-env: lint } | ||
| - { name: "Python Format", tox-env: format } | ||
| - { name: "Python Typecheck", tox-env: typecheck } | ||
| - { name: "Spec Lint", tox-env: spec-lint } | ||
| - { name: "Lock Check", tox-env: lockcheck } | ||
| - { name: "Action Lint", tox-env: actionlint } | ||
| - { name: "Changelog", tox-env: changelog } | ||
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
| - name: Install uv and Python | ||
| uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182 | ||
| with: | ||
| enable-cache: true | ||
| cache-dependency-glob: "uv.lock" | ||
| version: ${{ vars.UV_VERSION }} | ||
| python-version: ${{ vars.DEFAULT_PYTHON_VERSION }} | ||
| - name: Run ${{ matrix.name }} | ||
| run: uvx tox -e ${{ matrix.tox-env }} | ||
|
|
||
| markdownlint: | ||
| name: Markdown Lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
| - uses: DavidAnson/markdownlint-cli2-action@05f32210e84442804257b2a6f20b273450ec8265 | ||
| with: | ||
| globs: | | ||
| docs/**/*.md | ||
| *.md | ||
|
|
||
| sha-pinned-actions: | ||
| name: SHA Pinned Actions | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
| - name: Ensure SHA pinned actions | ||
| uses: zgosalvez/github-actions-ensure-sha-pinned-actions@6124774845927d14c601359ab8138699fa5b70c3 | ||
|
Comment on lines
+52
to
+58
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is available in the repository settings now, unless this serves a different purpose?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. |
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've done a bit more reading into this tool. It's not as bad as I feared. You can't sneak a hook into It still makes me uncomfortable, and I would really rather not promote it, but I'll no longer die on this hill.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for checking it out, this was unintentionally committed, sorry about that! |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v5.0.0 | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| - id: end-of-file-fixer | ||
| - id: check-yaml | ||
| - id: check-toml | ||
| - id: check-added-large-files | ||
|
|
||
| - repo: local | ||
| hooks: | ||
| # Fast file-level checks (run on changed files only) | ||
| - id: ruff-check | ||
| name: Python lint (ruff) | ||
| entry: uv run ruff check --fix | ||
| language: system | ||
| types: [python] | ||
|
|
||
| - id: ruff-format | ||
| name: Python format (ruff) | ||
| entry: uv run ruff format | ||
| language: system | ||
| types: [python] | ||
|
|
||
| - id: codespell | ||
| name: Spellcheck (codespell) | ||
| entry: uv run codespell | ||
| language: system | ||
| types_or: [python, markdown, yaml, ini] | ||
|
|
||
| # Project-level checks (run on whole project) | ||
| - id: mypy | ||
| name: Python typecheck (mypy) | ||
| entry: uv run mypy | ||
| language: system | ||
| types: [python] | ||
| pass_filenames: false | ||
|
|
||
| - id: spec-lint | ||
| name: Ethereum spec lint | ||
| entry: uv run ethereum-spec-lint | ||
| language: system | ||
| types: [python] | ||
| pass_filenames: false | ||
|
|
||
| - id: lockcheck | ||
| name: Lock file check (uv) | ||
| entry: uv lock --check | ||
| language: system | ||
| files: ^(pyproject\.toml|uv\.lock)$ | ||
| pass_filenames: false | ||
|
|
||
| - id: actionlint | ||
| name: GitHub Actions lint | ||
| entry: uv run actionlint | ||
| language: system | ||
| files: ^\.github/workflows/.*\.ya?ml$ | ||
| pass_filenames: false | ||
|
|
||
| - id: changelog | ||
| name: Changelog validation | ||
| entry: uv run python scripts/fast_checks.py changelog | ||
| language: system | ||
| files: ^docs/CHANGELOG\.md$ | ||
| pass_filenames: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, instead of duplicating check, would
on: workflow_runwork?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm,
workflow_runhas a few security considerations. Perhapsworkflow_callmight be safer.