Skip to content

Commit

Permalink
CI: Add GitHub workflow to run pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfr committed Aug 17, 2023
1 parent 80a51d6 commit 70b20bc
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Lint

on:
pull_request:
push:
branches:
- main
- 5.*

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

jobs:
pre-commit:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: pre-commit/[email protected]
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
hooks:
- id: check-added-large-files
args: ['--maxkb=1024']
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
6 changes: 5 additions & 1 deletion scripts/check_filenames.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ unexpected_files=$(find . -mindepth 1 \( -type d \( \
-path ./.git -o \
-path ./ARCHIVE -o \
-path ./scripts \
\) -o -type f \( -name README.md -o -name "*.s4ext" \) \) -prune -o -print)
\) -o -type f \( \
-name .pre-commit-config.yaml -o \
-name README.md -o \
-name "*.s4ext" \
\) \) -prune -o -print)

for unexpected_file in $unexpected_files; do
echo $unexpected_file
Expand Down

0 comments on commit 70b20bc

Please sign in to comment.