summaryrefslogtreecommitdiff
path: root/.github/workflows/darker-lint.yml
blob: 9a0e6d0f1c98ccae15ce4567802ac5dcce3c6590 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
name: Darker Lint

on:
  pull_request:
    branches:
      - current

jobs:
  darker-lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: actions/setup-python@v5

      - name: darker install
        run: |
          pip install --upgrade darker~=2.1.1
          
      - name: analyze
        run: |
          darker --revision current .

      # - name: Get head commit ID
      #   id: get-head-commit
      #   run: |
      #     HEAD_COMMIT=$(jq -r .pull_request.head.sha "$GITHUB_EVENT_PATH")
      #     echo "head_commit=$HEAD_COMMIT" >> "$GITHUB_OUTPUT"

      # - name: Get base commit ID
      #   id: get-base-commit
      #   run: |
      #     BASE_COMMIT=$(jq -r .pull_request.base.sha "$GITHUB_EVENT_PATH")
      #     echo "base_commit=$BASE_COMMIT" >> "$GITHUB_OUTPUT"

      # - name: Use commit IDs
      #   run: |
      #     echo "Head commit ID: ${{ steps.get-head-commit.outputs.head_commit }}"
      #     echo "Base commit ID: ${{ steps.get-base-commit.outputs.base_commit }}"

      # - uses: akaihola/darker@v2.1.1
      #   with:
      #     options: "--check --diff --isort --color"
      #     src: "."
      #     version: "~=2.1.1"
      #     lint: "flake8,pylint==2.13.1"
      #     revision: "current..."