forked from rahul-deepsource/pyaction
-
Notifications
You must be signed in to change notification settings - Fork 10
/
actions-only_changed_files.yml
26 lines (26 loc) · 1.09 KB
/
actions-only_changed_files.yml
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
name: Lint only files changed in Pull Request, and ignore Missing docstrings
on:
pull_request:
types: [ opened, reopened, synchronize, edited ]
jobs:
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- name: Check out source repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # This is necessary to get the commits
- name: Set up Python environment
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Get changed python files between base and head
run: >
echo "CHANGED_FILES=$(echo $(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} -- | grep \.py))" >> $GITHUB_ENV
- if: ${{ env.CHANGED_FILES }}
uses: marian-code/python-lint-annotate@v3
with:
python-root-list: ${{ env.CHANGED_FILES }}
extra-pylint-options: "--disable=C0114,C0116" # Missing doctrings
extra-pydocstyle-options: "--ignore=D1" # Missing doctrings http://www.pydocstyle.org/en/stable/error_codes.html#grouping