From e4397a9f07b41228d55eff76aefc5f4cbfef257b Mon Sep 17 00:00:00 2001 From: Tomasz Kwiatkowski Date: Wed, 6 Nov 2024 13:13:52 +0100 Subject: [PATCH 1/4] Linter --- .github/workflows/formatter.yml | 23 +++++++++++++++++++++++ pyproject.toml | 8 ++++++++ 2 files changed, 31 insertions(+) create mode 100644 .github/workflows/formatter.yml diff --git a/.github/workflows/formatter.yml b/.github/workflows/formatter.yml new file mode 100644 index 0000000..d8a39d0 --- /dev/null +++ b/.github/workflows/formatter.yml @@ -0,0 +1,23 @@ +name: Python Formatter (isort & black) + +on: + pull_request: + branches: [main] + +jobs: + formatting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.9' + - name: Install isort and black + run: | + python -m pip install --upgrade pip + pip install isort black + - name: Run isort and black + run: | + isort -c + black --check diff --git a/pyproject.toml b/pyproject.toml index 01a2b9a..84bb536 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,11 @@ [build-system] requires = ["setuptools>=67.0"] build-backend = "setuptools.build_meta" + +[tool.isort] +line_length = 120 +multi_line_output = 1 +include_trailing_comma = True + +[tool.black] +line_length = 120 From dc392b7602e746bd0f680cb9e07fc2da9f221d55 Mon Sep 17 00:00:00 2001 From: Tomasz Kwiatkowski Date: Wed, 6 Nov 2024 13:15:34 +0100 Subject: [PATCH 2/4] Fix isort --- .github/workflows/formatter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/formatter.yml b/.github/workflows/formatter.yml index d8a39d0..c5376bf 100644 --- a/.github/workflows/formatter.yml +++ b/.github/workflows/formatter.yml @@ -19,5 +19,5 @@ jobs: pip install isort black - name: Run isort and black run: | - isort -c + isort -c . black --check From bb9d7c741e532b8192b22ba2989249326e3971ee Mon Sep 17 00:00:00 2001 From: Tomasz Kwiatkowski Date: Wed, 6 Nov 2024 13:17:42 +0100 Subject: [PATCH 3/4] Fix toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 84bb536..d78f6bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [tool.isort] line_length = 120 multi_line_output = 1 -include_trailing_comma = True +include_trailing_comma = true [tool.black] line_length = 120 From e4fd9582de569c06e1ad14b8dc739786bab044d2 Mon Sep 17 00:00:00 2001 From: Tomasz Kwiatkowski Date: Wed, 6 Nov 2024 13:19:01 +0100 Subject: [PATCH 4/4] Fix black --- .github/workflows/formatter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/formatter.yml b/.github/workflows/formatter.yml index c5376bf..6b37756 100644 --- a/.github/workflows/formatter.yml +++ b/.github/workflows/formatter.yml @@ -20,4 +20,4 @@ jobs: - name: Run isort and black run: | isort -c . - black --check + black --check .