From f69e45541a5423dc4025f661c0ab389fcbe4c4d8 Mon Sep 17 00:00:00 2001 From: za Date: Fri, 26 Jan 2024 14:24:18 +0700 Subject: [PATCH] Added black.yml for github actions integrations docs: https://black.readthedocs.io/en/stable/integrations/github_actions.html --- .github/workflows/black.yml | 10 ++++++++++ .github/workflows/pre-commit.yml | 9 ++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/black.yml diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml new file mode 100644 index 000000000..9065b5e02 --- /dev/null +++ b/.github/workflows/black.yml @@ -0,0 +1,10 @@ +name: Lint + +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: psf/black@stable diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index e70884cef..a90d8197a 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -23,9 +23,12 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.9" - - name: Black - description: Format Python code with Black - language: python + - name: Format python code with black + uses: psf/black@stable + with: + options: "--check --verbose" + src: "./scripts" + version: "~= 22.0" - uses: actions/setup-node@v4 with: node-version: 20