diff --git a/.github/scripts/kernel_checker.py b/.github/scripts/kernel_checker.py index 12ea8b64a0d..db69312dcf8 100755 --- a/.github/scripts/kernel_checker.py +++ b/.github/scripts/kernel_checker.py @@ -41,6 +41,7 @@ KERNEL_IGNORED_EXTENSIONS = [ '.yml', + '.yaml', '.css', '.idx', '.md', @@ -148,4 +149,3 @@ def main(): if __name__ == '__main__': exit(main()) - diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50c1b18717e..bd05a41a6bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,5 @@ name: CI Checks on: - push: - branches: ["**"] pull_request: branches: [main] workflow_dispatch: @@ -44,4 +42,3 @@ jobs: - name: URL Checker run: | bash kernel/.github/actions/url_verifier.sh kernel - diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 00000000000..10a997ff6ce --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,18 @@ +name: Linters + +on: + pull_request: + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - id: file_changes + uses: trilom/file-changes-action@v1.2.4 + with: + output: ' ' + - uses: pre-commit/action@v2.0.0 + with: + extra_args: --files ${{ steps.file_changes.outputs.files}} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000000..23ddf9ec7de --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,18 @@ +# 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: v3.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + - id: mixed-line-ending + args : [--fix=auto] + - id: check-case-conflict + - id: check-executables-have-shebangs + - id: check-json + - id: check-merge-conflict + - id: check-symlinks + - id: check-ast