Skip to content

Commit

Permalink
add python lint action
Browse files Browse the repository at this point in the history
  • Loading branch information
rndmh3ro committed Nov 23, 2023
1 parent a3247b6 commit e3fd80d
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 2 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/python_linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Python Linting

on:
workflow_call:

jobs:
linting:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Setup Python
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: abatilo/actions-poetry@v2

- name: Install required dependencies
run: poetry install

- name: Run black
run: poetry run black src/
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,42 @@ jobs:
secrets:
GALAXY_API_KEY: ${{ secrets.GALAXY_API_KEY }}
```
### Python Linting
#### Description
Lint Python code with poetry and black.
It should run on `push` and `pull_request`.

The action sets up Python and Poetry, installs required dependencies and lints the code.

#### Inputs

#### Example Usage

``` yaml
name: Linting
on: [push, pull_request]
jobs:
linting:
# docs: https://github.com/telekom-mms/.github#python-linting
uses: telekom-mms/.github/.github/workflows/python_linting.yml@main
```


### Golang Linting

#### Description

Linting Golang code.
Lint Golang code.

It should run on `push` and `pull_request`.

The action sets up Go, installs needed modules and lints the code.
The action sets up Go, installs required modules and lints the code.

#### Inputs

Expand Down

0 comments on commit e3fd80d

Please sign in to comment.