forked from NHERI-SimCenter/DamageAndLossModelLibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (36 loc) · 952 Bytes
/
format_and_lint.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Format and Lint Code
on:
push:
permissions:
contents: write
jobs:
format_and_lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Run Black
uses: psf/black@stable
with:
options: "-S"
- name: Commit changes
run: |
git config --global user.name 'GitHubBot'
git config --global user.email '[email protected]'
git add .
if git diff-index --quiet HEAD --; then
echo "No changes to commit."
else
git commit -m "Format code with Black."
git push
fi
- name: Install Flake8
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Run Flake8
run: flake8 .