Skip to content

Commit b5ba754

Browse files
authored
Create python-stylecheck action
A rudimentary style checker using the zero-config linter from https://github.com/marketplace/actions/python-lint-annotate-maintain-code-quality-with-annotated-prs-and-pushes and with inspiration from https://github.com/marian-code/python-lint-annotate/blob/master/examples/actions-only_changed_files.yml Signed-off-by: Jonas Bardino <bardino@science.ku.dk>
1 parent 174ed0e commit b5ba754

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Python Style Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- edge
7+
- main
8+
pull_request:
9+
branches:
10+
- edge
11+
- main
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+
- name: Get changed python files between base and head
21+
run: >
22+
echo "CHANGED_FILES=$(echo $(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} -- | grep \.py))" >> $GITHUB_ENV
23+
- if: ${{ env.CHANGED_FILES }}
24+
uses: marian-code/python-lint-annotate@v4
25+
with:
26+
python-root-list: ${{ env.CHANGED_FILES }}

0 commit comments

Comments
 (0)