Skip to content

Commit

Permalink
build: Run linters & formatters via pre-commit (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
l0b0 authored Oct 11, 2024
1 parent 317f20f commit e3150e9
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 9 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,9 @@ jobs:
run: |
pip install poetry
poetry install --no-root
- name: Format
- name: Lint & format
run: |
poetry run black --check --diff linz_logger/*
- name: Lint
run: |
poetry run pylint linz_logger/*
- name: Import Sorting
run: |
poetry run isort --check --diff linz_logger/*
poetry run pre-commit run --all-files
- name: Test
run: |
poetry run pytest
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Configuration file for pre-commit (https://pre-commit.com/)
# Please run `pre-commit run --all-files` when adding or changing entries.

repos:
- repo: local
hooks:
- id: black
name: black
entry: black
language: system
stages: [commit]
types: [python]

- id: isort
name: isort
entry: isort
language: system
stages: [commit]
types: [python]

- id: pylint
name: pylint
entry: pylint
language: system
stages: [commit]
types: [python]
require_serial: true
165 changes: 164 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ python-ulid = "^1.1.0"
[tool.poetry.group.dev.dependencies]
black = "^24.1.1"
isort = "^5.13.1"
pre-commit = "*"
pylint = "^3.0.2"
pytest = ">=7.4.4,<9.0.0"
pytest-dependency = "^0.6.0"
Expand Down

0 comments on commit e3150e9

Please sign in to comment.