From 2595580d3da2d3d99b4700860ffe695b461e1daa Mon Sep 17 00:00:00 2001 From: Ray Douglass Date: Tue, 12 Sep 2023 13:38:09 -0400 Subject: [PATCH] Add .pre-commit-config.yaml --- .github/workflows/pr.yml | 10 +++++----- .pre-commit-config.yaml | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 9469120..16a4ec6 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -7,21 +7,21 @@ concurrency: cancel-in-progress: true jobs: - format: + pre-commit: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - - name: Run black formatter - uses: psf/black@stable with: - src: media_management_scripts + fetch-depth: 0 + - name: Run pre-commit + uses: pre-commit/action@v3.0.0 test: runs-on: ubuntu-latest strategy: matrix: python-version: ["3.9", "3.10", "3.11"] - needs: format + needs: pre-commit steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..cd149a4 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,14 @@ +# 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.2.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + - repo: https://github.com/psf/black + rev: 23.9.1 + hooks: + - id: black