From 6ea683f1544656245039a1864ba7ac8d50000ee7 Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Sun, 9 Jan 2022 13:19:26 +0100 Subject: [PATCH] add pre-commit lint environment --- .github/lint_environment.yml | 7 +++++++ .github/workflows/linter.yml | 23 +++++++++++++++++++++++ .pre-commit-config.yaml | 5 +++++ 3 files changed, 35 insertions(+) create mode 100644 .github/lint_environment.yml create mode 100644 .github/workflows/linter.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/lint_environment.yml b/.github/lint_environment.yml new file mode 100644 index 0000000..7772b59 --- /dev/null +++ b/.github/lint_environment.yml @@ -0,0 +1,7 @@ +name: lint +channels: + - conda-forge +dependencies: + - pre-commit + - pip + # - clang-format ==X.X diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..03acc62 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,23 @@ +name: Run Linters + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: install mamba + uses: mamba-org/provision-with-micromamba@v11 + with: + environment-file: .github/lint_environment.yml + - name: Run all linters + shell: bash -l {0} + run: | + pre-commit run --all-files --verbose diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..7773d25 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,5 @@ +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.1.0 + hooks: + - id: end-of-file-fixer + exclude: ^(test/files|autotest/) -- 2.30.2