Skip to content

Commit 2a7e85f

Browse files
Create README.md
1 parent 601a061 commit 2a7e85f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# YAPF-Action
2+
A GitHub action that runs [YAPF](https://github.com/google/yapf) to test if your python code is correctly formatted.
3+
4+
The action uses the `--diff` parameter of YAPF to return
5+
- SUCCESS: exit-code=zero → no changes were necessary, code is YAPF-formatted
6+
- FAIL: exit-code=non-zero → not correctly formatted or program error
7+
8+
## Usage
9+
To use this action in your repository, create a file like `.github/workflows/yapf_check.yml` with the following content:
10+
11+
```
12+
name: YAPF Formatting Check
13+
on: [push]
14+
jobs:
15+
16+
build:
17+
name: Build
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: run YAPF to test if python code is correctly formatted
21+
uses: AlexanderMelde/yapf-action@master
22+
```
23+
24+
You can fork and modify the `entrypoint.sh` script to use other [yapf parameters](https://github.com/google/yapf#usage), e.g. for setting a different code style (default is PEP8).

0 commit comments

Comments
 (0)