Added github action for automatic code formating
This commit is contained in:
parent
9327163e97
commit
f8a6271f9a
36
.github/workflows/format.yml
vendored
Normal file
36
.github/workflows/format.yml
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
name: Prettier
|
||||
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
format:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: "3.x"
|
||||
architecture: "x64"
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install flake8 black
|
||||
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
|
||||
- name: Format with black
|
||||
run: black --check .
|
||||
|
||||
- name: Commit changes
|
||||
uses: stefanzweifel/git-auto-commit-action@v4.1.2
|
||||
with:
|
||||
commit_message: Apply formatting changes
|
||||
branch: ${{ github.head_ref }}
|
Loading…
x
Reference in New Issue
Block a user