diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml new file mode 100644 index 00000000000..1386cc9351b --- /dev/null +++ b/.github/workflows/linting.yaml @@ -0,0 +1,26 @@ +name: linting +on: pull_request + +jobs: + checkLinting: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.base.sha }} + - uses: actions/checkout@v3 + with: + ref: ${{ github.sha }} + - uses: actions/setup-python@v4 + with: + python-version: 3.7.9 + architecture: x86 + - name: Install required Python packages + run: | + python -m pip install flake8~=3.7.7 flake8-tabs==2.1.0 + - name: generate pull request diff + run: | + git diff -U0 ${{ github.event.pull_request.base.sha }} | Out-File -FilePath _lint.diff + - name: Run flake8 + run: | + Get-Content -Path _lint.diff | python -Xutf8 -m flake8 --diff --config=tests/lint/flake8.ini