Skip to content

Commit 47ec2cf

Browse files
Merge pull request #369 from Mr-Sunglasses/main
Added Linting for Py files
2 parents 6d433e1 + b8bda2d commit 47ec2cf

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/linter.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: black-action
2+
on: [push, pull_request]
3+
jobs:
4+
linter_name:
5+
name: runner / black
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- name: Check files using the black formatter
10+
uses: rickstaa/action-black@v1
11+
id: action_black
12+
with:
13+
black_args: "."
14+
- name: Create Pull Request
15+
if: steps.action_black.outputs.is_formatted == 'true'
16+
uses: peter-evans/create-pull-request@v3
17+
with:
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
title: "Format Python code with psf/black push"
20+
commit-message: ":art: Python code fromated with psf/black"
21+
body: |
22+
There appear to be some python formatting errors in ${{ github.sha }}. This pull request
23+
uses the [psf/black](https://github.com/psf/black) formatter to fix these issues.
24+
base: ${{ github.head_ref }} # Creates pull request onto pull request or commit branch
25+
branch: actions/black

0 commit comments

Comments
 (0)