From 44384aad73da69b51c57fc7299457beecfcc1698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Fri, 3 Jan 2025 21:33:16 +0100 Subject: [PATCH] github/workflows/lint: add pre-commit hooks Tests some basic errors in files like trailing white-spaces. Additionally check the spelling with codespell. --- .github/workflows/lint.yml | 6 ++++++ .pre-commit-config.yaml | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9de1f83f87..3f74fea997 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -46,3 +46,9 @@ jobs: - uses: actions/checkout@v4 - uses: editorconfig-checker/action-editorconfig-checker@main - run: editorconfig-checker -config .editorconfig-checker.json + + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..e41ebee60b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,22 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-case-conflict + - id: check-executables-have-shebangs + - id: check-illegal-windows-names + - id: check-json + - id: check-shebang-scripts-are-executable + - id: check-xml + - id: check-yaml + - id: end-of-file-fixer + exclude: ^TOOLS/osxbundle/mpv.app/Contents/PkgInfo$ + - id: fix-byte-order-marker + - id: mixed-line-ending + - id: trailing-whitespace +- repo: https://github.com/codespell-project/codespell + rev: v2.3.0 + hooks: + - id: codespell + args: ["--ignore-words-list", "datas,DNE,enew,HDA,numer,ontop,optionA,Paeth,pathc,inout"] + exclude: ^misc/language.c$