Skip to content

Commit

Permalink
docs(TrueBrain#46): Adding documentation on advanced use-cases
Browse files Browse the repository at this point in the history
  • Loading branch information
r-ichard authored Oct 27, 2022
1 parent 18aeb2f commit deb9953
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,31 @@ steps:
with:
extra_arguments: "--hang-closing"
```

## Advanced use-case

The section below is an effort to document advanced use-cases that don't fit in the scope of this action.

Feel free to contribute to it !


### Run flake8 on changed files only

If you want to run flake8 only against changed files you can achieve it using the following code :

```
- uses: actions/checkout@v2
with:
fetch-depth: -1
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- id: find_changed_files
run: echo ::set-output name=changed_files::$(git diff --name-only ${{github.sha}} ${{github.event.pull_request.base.sha}} | tr ' ' '\n' | grep .py | tr '\n' ' ')
- uses: TrueBrain/actions-flake8@v2
with:
plugins: flake8-docstrings dlint flake8-bugbear flake8-simplify flake8-debugger flake8-print flake8-pep3101
only_warn: 1
extra_arguments: "${{steps.find_changed_files.outputs.changed_files}}"
```

0 comments on commit deb9953

Please sign in to comment.