Skip to content

Commit ec2d2cb

Browse files
committed
Added black.yml autoformatter action
1 parent 28d6a4a commit ec2d2cb

File tree

2 files changed

+28
-11
lines changed

2 files changed

+28
-11
lines changed

.github/workflows/black_formatter.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Format Python Code
2+
on: push
3+
jobs:
4+
python-code-format:
5+
runs-on: ubuntu-20.04
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: actions/setup-python@v4
9+
with:
10+
python-version: "3.10"
11+
architecture: "x64"
12+
- name: Display Python version
13+
run: python --version
14+
- name: Install packages
15+
run: pip install black autopep8 isort
16+
- name: Formatter
17+
run: |
18+
black ./LadybugTools_Engine/Python
19+
autopep8 --recursive --in-place --aggressive --aggressive ./LadybugTools_Engine/Python
20+
isort ./LadybugTools_Engine/Python
21+
- name: Create Pull Request
22+
uses: peter-evans/create-pull-request@v3
23+
with:
24+
commit-message: Auto code format
25+
title: Fixes by format action
26+
body: This is an auto-generated PR with fixes.
27+
labels: automated pr
28+
branch: python-code-format-patches

0 commit comments

Comments
 (0)