Skip to content

Commit

Permalink
Adding pre-commit checks
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbosch committed Jan 27, 2025
1 parent 91f5923 commit e79822c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
- uses: ./spdx
with:
files: "${{ env.files }}"
licenses: "${{ env.licenses }}"
licenses: "${{ env.licenses }}"
24 changes: 24 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: pre-commit

on: [pull_request]

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
pre-commit:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
# required to grab the history of the PR
fetch-depth: 0
submodules: 'true'
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: pre-commit/[email protected]
with:
extra_args: --color=always --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude_types: ["dbc"]
- id: end-of-file-fixer
exclude_types: ["dbc", "json"]
exclude: \.token$
- id: check-yaml
- id: check-added-large-files
2 changes: 1 addition & 1 deletion test/test_spdx.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@

import logging
import sys
import os
import os

0 comments on commit e79822c

Please sign in to comment.