You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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