Skip to content

Commit a0d40af

Browse files
committed
Enable the same style check actions with inline annotations about style issues
for the experimental+next branches as well. Does not cause errors and the annotatios can be hidden in the files diff view on PRs.
1 parent a831ba4 commit a0d40af

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Python Style Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- experimental
7+
- next
8+
pull_request:
9+
branches:
10+
- experimental
11+
- next
12+
13+
jobs:
14+
stylecheckpython:
15+
name: Style Check Python with Lint
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Check out source repository
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0 # This is necessary to get the commits
22+
- name: Get changed python files between base and head
23+
run: >
24+
echo "CHANGED_FILES=$(echo $(git diff --diff-filter=ACMRTB --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} -- | grep -E '\.py$'))" >> $GITHUB_ENV
25+
- if: ${{ env.CHANGED_FILES }}
26+
uses: marian-code/python-lint-annotate@v4
27+
with:
28+
python-root-list: ${{ env.CHANGED_FILES }}
29+
extra-pycodestyle-options: "--max-line-length=80"
30+
extra-black-options: "--line-length=80"
31+
extra-isort-options: "--line-length=80 -m=HANGING_INDENT"
32+
# NOTE: we disable flake8 and pylint here to avoid overlap with lint action and limit noise
33+
use-flake8: false
34+
extra-flake8-options: "--max-line-length=80"
35+
use-pylint: false
36+
# NOTE: pylint C0209 string format suggestions requires python3.6+ so disable here
37+
# https://pylint.pycqa.org/en/latest/user_guide/messages/convention/consider-using-f-string.html
38+
extra-pylint-options: "--max-line-length=80 --disable=C0209"

0 commit comments

Comments
 (0)