Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Static analysis

on:
push:
branches:
- master
- devel
pull_request:
branches:
- master
- devel

defaults:
run:
shell: bash

jobs:

black:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Code formatting with black
run: |
pip install black "black[jupyter]"
black --check .

isort:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Code formatting with isort
run: |
pip install isort
isort --check .

15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
# https://black.readthedocs.io/en/stable/integrations/source_version_control.html#
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.11.0
hooks:
- id: black
files: \.py$

# https://pycqa.github.io/isort/docs/configuration/pre-commit.html
- repo: https://github.com/PyCQA/isort
rev: 7.0.0
hooks:
- id: isort
files: \.py$
args: [--profile=black]
2 changes: 1 addition & 1 deletion fprettify.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@

from fprettify import run # pragma: no cover

if __name__ == '__main__': # pragma: no cover
if __name__ == "__main__": # pragma: no cover
run()
Loading