Skip to content

Commit

Permalink
Crerate job to run linters (#13)
Browse files Browse the repository at this point in the history
* Add job for linters

* Update .github/workflows/test.yml

Co-authored-by: Wojciech Fiołka <[email protected]>

* Create new workflow

---------

Co-authored-by: Wojciech Fiołka <[email protected]>
  • Loading branch information
gkodrzycki and Kabanosk authored Jul 23, 2024
1 parent 02e7885 commit 141940a
Show file tree
Hide file tree
Showing 6 changed files with 253 additions and 165 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Check linters

on:
push:
branches:
- main
- 'feature/*'
- '[0-9]*-*[a-zA-Z]*' # regex should match typical issue branches names
pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry==1.8.1
poetry install --no-root
- name: Run isort
run: |
poetry run isort --check-only .
- name: Run black
run: |
poetry run black --check .
- name: Run pylint
run: |
poetry run pylint **/*.py
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
push:
branches:
- main
- 6-docker-compose-instead-of-docker-compose
- 'feature/*'
- '[0-9]*-*[a-zA-Z]*' # regex should match typical issue branches names
pull_request:
branches:
- main
Expand Down Expand Up @@ -63,3 +64,5 @@ jobs:

- name: Stop and remove container
run: docker compose down


3 changes: 1 addition & 2 deletions alembic/env.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
from logging.config import fileConfig

from dotenv import load_dotenv
from sqlalchemy import create_engine
Expand All @@ -9,7 +8,7 @@

# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = load_dotenv()
CONFIG = load_dotenv()

# Interpret the config file for Python logging.
# This line sets up loggers basically.
Expand Down
Loading

0 comments on commit 141940a

Please sign in to comment.