diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..9afa91e1e --- /dev/null +++ b/.github/workflows/lint.yml @@ -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/action@v3.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..175be59f4 --- /dev/null +++ b/.pre-commit-config.yaml @@ -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 diff --git a/scripts/check_filenames.sh b/scripts/check_filenames.sh index 25ca974d7..69833251b 100755 --- a/scripts/check_filenames.sh +++ b/scripts/check_filenames.sh @@ -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