Skip to content

Run pre-commit in GitHub Actions #661

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,36 @@ name: Codespell

on:
push:
paths:
- '**/*' # Run on all files
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- run: pip install --upgrade pip
- run: pip install pylint
- run: npm install -g markdown-link-check

- name: Run pre-commit hooks
uses: pre-commit/action@v3.0.1

codespell:
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 1 addition & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,10 @@ repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.5
hooks:
- id: ruff
- id: ruff-check
args: [ --fix ]
language: system
types: [python]
stages: [pre-commit]
# Run the formatter.
- id: ruff-format
types_or: [ python ]
stages: [pre-commit]

- repo: https://github.com/gruntwork-io/pre-commit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def _on_parameter_value_change(event: tk.Event) -> None:
else None
)
valid: bool = True
value: float = param._new_value
value: float = param._new_value # noqa: SLF001

# Check if the input is a valid float
try:
Expand Down
Loading