Skip to content

Commit

Permalink
Adjust workflows
Browse files Browse the repository at this point in the history
Replace previous linting workflow with updated version, that uses isort and black. (see #80)
  • Loading branch information
a-niem committed Jan 30, 2024
1 parent 3ac99fb commit ee9ddf3
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 36 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/ci.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/code_style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Code Style
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
workflow_dispatch:

jobs:
Code_Style_Adherence:
runs-on: ubuntu-latest
strategy:
matrix:
python_version: ['3.11']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install isort
pip install black
- name: Lint
run: |
flake8 --append-config ./RodTracker/setup.cfg ./RodTracker
flake8 ./ParticleDetection
- name: Import Sorting
run: |
isort --settings-file ./RodTracker/pyproject.toml --check ./RodTracker
isort --settings-file ./ParticleDetection/pyproject.toml --check ./ParticleDetection
- name: Style Adherence
run: |
black --config ./RodTracker/pyproject.toml --check ./RodTracker
black --config ./ParticleDetection/pyproject.toml --check ./ParticleDetection
8 changes: 8 additions & 0 deletions ParticleDetection/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,11 @@ addopts = "--cov=src --cov-report=html"
testpaths = [
"tests/",
]

[tool.black]
line-length = 79
target-version = ['py38', 'py39', 'py310', 'py311']

[tool.isort]
profile = "black"
line_length = 79
13 changes: 13 additions & 0 deletions RodTracker/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,16 @@ enable = true
vcs = "git"
style = "pep440"
bump = true

[tool.black]
line-length = 79
target-version = ['py38', 'py39', 'py310', 'py311']
extend-exclude = '''
(
.*mainwindow_layout..*
)
'''

[tool.isort]
profile = "black"
line_length = 79
2 changes: 1 addition & 1 deletion RodTracker/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ exclude =
__pycache__,
build,
dist,
src/RodTracker/ui/mainwindow_layout.py
*src/RodTracker/ui/mainwindow_layout.py

0 comments on commit ee9ddf3

Please sign in to comment.