Skip to content

Commit

Permalink
action-pylint initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Sjögren <[email protected]>
  • Loading branch information
konstruktoid committed Jan 8, 2020
1 parent 3ca3a2a commit ce75d71
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Dockerfile
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"]
50 changes: 50 additions & 0 deletions README.md
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 .
```
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh -l

black --quiet --check .
flake8 .
6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
black
flake8
flake8-bandit
flake8-bugbear
flake8-deprecated
flake8-executable

0 comments on commit ce75d71

Please sign in to comment.