From ea893c9e3b4fdfe6ea6817c6be53b5bbbb062147 Mon Sep 17 00:00:00 2001 From: Dani Bodor Date: Tue, 12 Mar 2024 11:23:32 +0100 Subject: [PATCH 1/2] style: ruff formatter --- eit_dash/__init__.py | 1 + eit_dash/utils/common.py | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/eit_dash/__init__.py b/eit_dash/__init__.py index b7d94e0..7c1448c 100644 --- a/eit_dash/__init__.py +++ b/eit_dash/__init__.py @@ -1,4 +1,5 @@ """Documentation about eit_dash.""" + import logging logging.getLogger(__name__).addHandler(logging.NullHandler()) diff --git a/eit_dash/utils/common.py b/eit_dash/utils/common.py index 0337810..2db3180 100644 --- a/eit_dash/utils/common.py +++ b/eit_dash/utils/common.py @@ -25,13 +25,16 @@ def create_slider_figure( if eit_variants is None: eit_variants = ["raw"] - traces = [{ - "x": dataset.eit_data[eit_variant].time, - "y": dataset.eit_data[eit_variant].global_impedance, - "type": "scatter", - "mode": "lines", - "name": "a_level", - } for eit_variant in eit_variants] + traces = [ + { + "x": dataset.eit_data[eit_variant].time, + "y": dataset.eit_data[eit_variant].global_impedance, + "type": "scatter", + "mode": "lines", + "name": "a_level", + } + for eit_variant in eit_variants + ] for cont_signal in continuous_data: traces.append( # noqa: PERF401 From a45262de9991d5211f0d408c8785253053cca9ca Mon Sep 17 00:00:00 2001 From: Dani Bodor Date: Tue, 12 Mar 2024 11:24:22 +0100 Subject: [PATCH 2/2] ci: check for formatting in ruff action --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index abb270e..6725c2a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,5 +72,7 @@ jobs: run: | python3 -m pip install --upgrade pip poetry poetry install --with test - - name: Check linting using ruff - run: poetry run ruff . + - name: Check linting and formatting using ruff + run: | + poetry run ruff check + poetry run ruff format --check