Skip to content
Draft
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
52 changes: 6 additions & 46 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Code Formatting Check
on:
pull_request:
jobs:
pre-commit-hooks:
name: Run pre-commit hooks for linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pre-commit/action@v3.0.1
git-commit-check:
name: Check Git Commit Formatting
runs-on: ubuntu-latest
Expand Down Expand Up @@ -40,49 +46,3 @@ jobs:
commits="$(git rev-list origin/${{ github.base_ref }}..HEAD --skip 1 | paste -s -d,)"
echo "Checking commits: $commits"
gitlint --debug --commits "$commits",
python-check:
name: Check Python Code Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Dependencies
run: |
sudo env DEBIAN_FRONTEND=noninteractive apt update
sudo env DEBIAN_FRONTEND=noninteractive apt install -y python3-venv
- name: Linting with Ruff
run: |
python3 -m venv .venv
source .venv/bin/activate
pip install ruff==0.11.3
for python_file in $(git diff --name-only --diff-filter=ACMRTUXB origin/${{ github.base_ref }} | grep -E "\.py$");
do
ruff format --check -v "$python_file"
ruff check "$python_file"
done
yaml-check:
name: Check YAML Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '>=1.21.0'
- name: Run yamlfmt
run: |
go install github.com/google/yamlfmt/cmd/yamlfmt@v0.16.0
yamlfmt -lint .
rust-check:
name: Check Rust Code
runs-on: ubuntu-latest
env:
RUSTFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v4
- name: Run clippy
run: |
cargo clippy --workspace --all-targets --all-features -v
- name: Run fmt
run: |
cargo fmt --check -v
2 changes: 0 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,3 @@ repos:
rev: f01f898 # pre-commit hooks is not tagged yet
hooks:
- id: licensesnip
args:
- 'check'
Loading