Skip to content

Commit 5b97651

Browse files
authored
Merge pull request #4 from nmenardg-keeper/example-actions-yml
Added an example actions.yml file
2 parents a903670 + d8109ec commit 5b97651

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ steps:
4949
python-version: "3.7"
5050
```
5151
52+
### Examples
53+
* [Only lint changed files, and ignore missing docstrings](examples/actions-only_changed_files.yml)
54+
5255
## Details
5356
5457
Uses `actions/setup-python@v2`. Only python `3.6` - `3.10` version are tested since
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Lint only files changed in Pull Request, and ignore Missing docstrings
2+
on:
3+
pull_request:
4+
types: [ opened, reopened, synchronize, edited ]
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
name: Lint
9+
steps:
10+
- name: Check out source repository
11+
uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 0 # This is necessary to get the commits
14+
- name: Set up Python environment
15+
uses: actions/setup-python@v3
16+
with:
17+
python-version: "3.8"
18+
- name: Get changed python files between base and head
19+
run: >
20+
echo "CHANGED_FILES=$(echo $(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} -- | grep \.py))" >> $GITHUB_ENV
21+
- if: ${{ env.CHANGED_FILES }}
22+
uses: marian-code/python-lint-annotate@v3
23+
with:
24+
python-root-list: ${{ env.CHANGED_FILES }}
25+
extra-pylint-options: "--disable=C0114,C0116" # Missing doctrings
26+
extra-pydocstyle-options: "--ignore=D1" # Missing doctrings http://www.pydocstyle.org/en/stable/error_codes.html#grouping

0 commit comments

Comments
 (0)