-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Thomas Sjögren <[email protected]>
- Loading branch information
1 parent
3ca3a2a
commit ce75d71
Showing
4 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM konstruktoid/alpine | ||
|
||
LABEL "com.github.actions.name"="Konstruktoid Python linting" | ||
LABEL "com.github.actions.description"="Python linting using black and flake8" | ||
LABEL "com.github.actions.icon"="mic" | ||
LABEL "com.github.actions.color"="purple" | ||
|
||
LABEL "repository"="https://github.com/konstruktoid/action-pylint" | ||
LABEL "homepage"="https://github.com/konstruktoid/action-pylint" | ||
LABEL "maintainer"="Thomas Sjögren <[email protected]>" | ||
|
||
COPY requirements.txt /requirements.txt | ||
|
||
RUN apk update && \ | ||
apk upgrade && \ | ||
apk --update add gcc musl-dev python3-dev python3 && \ | ||
pip3 install --upgrade pip && \ | ||
pip3 install -r /requirements.txt && \ | ||
apk del gcc musl-dev python3-dev && \ | ||
rm -rf /var/cache/apk/ | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
= Python linting and testing using black and flake8 | ||
|
||
A GitHub action that checks Python code using [black](https://github.com/psf/black) | ||
and [flake8](https://gitlab.com/pycqa/flake8). | ||
|
||
== Tools installed | ||
|
||
``` | ||
black | ||
flake8 | ||
flake8-bandit | ||
flake8-bugbear | ||
flake8-deprecated | ||
flake8-executable | ||
``` | ||
|
||
== Github Actions configuration examples | ||
|
||
```sh | ||
on: [push, pull_request] | ||
name: Python Linting | ||
jobs: | ||
PythonLinting: | ||
name: Python linting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Konstruktoid Python linting | ||
uses: konstruktoid/action-pylint@master | ||
``` | ||
|
||
``` | ||
workflow "Python Linting" { | ||
on = "push" | ||
resolves = ["python-linting"] | ||
} | ||
action "python-linting" { | ||
uses = "konstruktoid/action-pylint@master" | ||
} | ||
``` | ||
|
||
== Script | ||
|
||
```sh | ||
#!/bin/sh -l | ||
|
||
black --quiet --check . | ||
flake8 . | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh -l | ||
|
||
black --quiet --check . | ||
flake8 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
black | ||
flake8 | ||
flake8-bandit | ||
flake8-bugbear | ||
flake8-deprecated | ||
flake8-executable |