From a8277fd01827558f115953e2e9ac1ae0a6b01661 Mon Sep 17 00:00:00 2001 From: Adrien Date: Sat, 3 Feb 2024 18:04:09 +0100 Subject: [PATCH 01/39] =?UTF-8?q?=F0=9F=91=B7=20First=20try?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .woodpecker.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .woodpecker.yml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..1259718 --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,6 @@ +pipeline: + first-job: + image: busybox + commands: + - echo "first run" + -- 2.43.0 From 7ac719db2425a3c5e5b35f1755d830a224afdd8d Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 17:06:04 +0100 Subject: [PATCH 02/39] =?UTF-8?q?=F0=9F=91=B7=20Run=20Ruff=20linter=20on?= =?UTF-8?q?=20back-end=20pull=20requests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .woodpecker.yml | 6 ------ backend/.woodpecker/.lint.yaml | 9 +++++++++ 2 files changed, 9 insertions(+), 6 deletions(-) delete mode 100644 .woodpecker.yml create mode 100644 backend/.woodpecker/.lint.yaml diff --git a/.woodpecker.yml b/.woodpecker.yml deleted file mode 100644 index 1259718..0000000 --- a/.woodpecker.yml +++ /dev/null @@ -1,6 +0,0 @@ -pipeline: - first-job: - image: busybox - commands: - - echo "first run" - diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml new file mode 100644 index 0000000..0b0f32f --- /dev/null +++ b/backend/.woodpecker/.lint.yaml @@ -0,0 +1,9 @@ +steps: + - name: ruff + image: python:3.12-alpine + commands: + - pip install ruff + - ruff . --format github + when: + - event: pull_request + path: 'backend/**' -- 2.43.0 From ff808e7c8f4730fad53c6f8ba1131824793dcb0a Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 17:24:24 +0100 Subject: [PATCH 03/39] =?UTF-8?q?=F0=9F=92=9A=20Don't=20run=20linters=20on?= =?UTF-8?q?=20master,=20develop=20and=20release/*=20branches?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index 0b0f32f..d18d90f 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -5,5 +5,5 @@ steps: - pip install ruff - ruff . --format github when: - - event: pull_request - path: 'backend/**' + - branch: + exclude: [master, develop, release/*] -- 2.43.0 From c8732a037525ff46e6cad3f3d3eb0ef0de9b59b8 Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 17:40:06 +0100 Subject: [PATCH 04/39] =?UTF-8?q?=E2=9C=A8=20Run=20Mypy=20linter=20on=20ba?= =?UTF-8?q?ckend=20pull=20requests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 8 +++++++- backend/pyproject.toml | 5 +++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index d18d90f..f2e017a 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -3,7 +3,13 @@ steps: image: python:3.12-alpine commands: - pip install ruff - - ruff . --format github + - ruff --output-format github . when: - branch: exclude: [master, develop, release/*] + + - name: mypy + image: python:3.12-alpine + commands: | + pip install mypy + mypy . diff --git a/backend/pyproject.toml b/backend/pyproject.toml index 0156387..83b33f4 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -24,6 +24,7 @@ psycopg = "^3.1.9" pyyaml = "^6.0" fastapi-cache2 = {extras = ["redis"], version = "^0.2.1"} pydantic-settings = "^2.0.3" +ruff = "^0.2.1" [tool.poetry.group.db_updater.dependencies] aiofiles = "^22.1.0" @@ -48,8 +49,6 @@ pydantic-settings = "^2.0.3" requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" - - [tool.poetry.group.dev.dependencies] pylsp-mypy = "^0.6.2" mccabe = "^0.7.0" @@ -74,6 +73,8 @@ types-tqdm = "^4.65.0.1" [tool.mypy] plugins = "sqlalchemy.ext.mypy.plugin" +exclude = ['docker', 'docs'] +strict = true [tool.black] target-version = ['py311'] -- 2.43.0 From 6687c2de15141d4e369cd7d6ad96abdcc276477d Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 17:48:01 +0100 Subject: [PATCH 05/39] =?UTF-8?q?=F0=9F=92=9A=20Run=20backend=20linters=20?= =?UTF-8?q?on=20commits=20only?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Try to force the linters to run even if the previous one fails. --- backend/.woodpecker/.lint.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index f2e017a..1167f1f 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -1,15 +1,19 @@ +when: + - event: push + - branch: + exclude: [master, release/*] + steps: - name: ruff image: python:3.12-alpine commands: - pip install ruff - ruff --output-format github . - when: - - branch: - exclude: [master, develop, release/*] - name: mypy image: python:3.12-alpine commands: | pip install mypy mypy . + +runs_on: [ success, failure ] -- 2.43.0 From 10ecd40ef5f989ab37ac9df10f96e2e764f11632 Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 17:52:28 +0100 Subject: [PATCH 06/39] =?UTF-8?q?=F0=9F=92=9A=20Force=20the=20linters=20to?= =?UTF-8?q?=20run=20even=20if=20the=20previous=20one=20fails.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index 1167f1f..a90a5f6 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -6,14 +6,14 @@ when: steps: - name: ruff image: python:3.12-alpine + failure: ignore commands: - pip install ruff - ruff --output-format github . - name: mypy image: python:3.12-alpine + failure: ignore commands: | pip install mypy mypy . - -runs_on: [ success, failure ] -- 2.43.0 From bccbfe0ff3a18957845f41b353113da06375018a Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 18:30:43 +0100 Subject: [PATCH 07/39] =?UTF-8?q?=F0=9F=9A=A7=20First=20reviewdog=20try?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index a90a5f6..edec53b 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -7,13 +7,14 @@ steps: - name: ruff image: python:3.12-alpine failure: ignore - commands: - - pip install ruff - - ruff --output-format github . + commands: | + pip install ruff + ruff --output-format diff . - name: mypy image: python:3.12-alpine failure: ignore commands: | - pip install mypy - mypy . + wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s [vX.Y.Z] + pip install mypy + mypy . | eviewdog -f=mypy -reporter=gitea-pr-review -tee -- 2.43.0 From 0cddf9dc7e585ab9d5aa635ca046ecb8431a503d Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 18:34:51 +0100 Subject: [PATCH 08/39] =?UTF-8?q?=F0=9F=9A=A7=20Fix=20reviewdog=20version?= =?UTF-8?q?=20and=20setup=20ruff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index edec53b..fad11ee 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -8,13 +8,14 @@ steps: image: python:3.12-alpine failure: ignore commands: | + wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install ruff - ruff --output-format diff . + ruff --output-format sarif . | eviewdog -f=sarif -reporter=gitea-pr-review -tee - name: mypy image: python:3.12-alpine failure: ignore commands: | - wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s [vX.Y.Z] + wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install mypy mypy . | eviewdog -f=mypy -reporter=gitea-pr-review -tee -- 2.43.0 From 137c28387c2007127b0dd661ff2562b9630da01d Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 18:37:23 +0100 Subject: [PATCH 09/39] =?UTF-8?q?=F0=9F=9A=A7=20Fix=20eviewdog=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index fad11ee..6ecb782 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -10,7 +10,7 @@ steps: commands: | wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install ruff - ruff --output-format sarif . | eviewdog -f=sarif -reporter=gitea-pr-review -tee + ruff --output-format sarif . | ./bin/eviewdog -f=sarif -reporter=gitea-pr-review -tee - name: mypy image: python:3.12-alpine @@ -18,4 +18,4 @@ steps: commands: | wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install mypy - mypy . | eviewdog -f=mypy -reporter=gitea-pr-review -tee + mypy . | ./bin/eviewdog -f=mypy -reporter=gitea-pr-review -tee -- 2.43.0 From 2eb8d59a0e128502138484f00e9b7a5725fda594 Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 18:38:47 +0100 Subject: [PATCH 10/39] =?UTF-8?q?=F0=9F=9A=A7=20Fix=20typo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index 6ecb782..f7ad67f 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -10,7 +10,7 @@ steps: commands: | wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install ruff - ruff --output-format sarif . | ./bin/eviewdog -f=sarif -reporter=gitea-pr-review -tee + ruff --output-format sarif . | ./bin/reviewdog -f=sarif -reporter=gitea-pr-review -tee - name: mypy image: python:3.12-alpine @@ -18,4 +18,4 @@ steps: commands: | wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install mypy - mypy . | ./bin/eviewdog -f=mypy -reporter=gitea-pr-review -tee + mypy . | ./bin/reviewdog -f=mypy -reporter=gitea-pr-review -tee -- 2.43.0 From 58c18a04798da1c47c1f3125bc064fdbfc2eb7f5 Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 18:54:05 +0100 Subject: [PATCH 11/39] =?UTF-8?q?=F0=9F=9A=A7=20Enable=20REVIEWDOG=5FGITEA?= =?UTF-8?q?=5FAPI=5FTOKEN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index f7ad67f..4c7ac0c 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -7,6 +7,7 @@ steps: - name: ruff image: python:3.12-alpine failure: ignore + secrets: ["reviewdog_gitea_api_token"] commands: | wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install ruff @@ -15,6 +16,7 @@ steps: - name: mypy image: python:3.12-alpine failure: ignore + secrets: ["reviewdog_gitea_api_token"] commands: | wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install mypy -- 2.43.0 From 55401dcd0cccfb329f89f7f99090bc7038d36b34 Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 19:05:15 +0100 Subject: [PATCH 12/39] =?UTF-8?q?=F0=9F=9A=A7=20Add=20gitea=5Faddress=20se?= =?UTF-8?q?cret?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index 4c7ac0c..3013d98 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -1,13 +1,13 @@ when: - event: push - - branch: + branch: exclude: [master, release/*] steps: - name: ruff image: python:3.12-alpine failure: ignore - secrets: ["reviewdog_gitea_api_token"] + secrets: ["reviewdog_gitea_api_token", "gitea_address"] commands: | wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install ruff @@ -16,7 +16,7 @@ steps: - name: mypy image: python:3.12-alpine failure: ignore - secrets: ["reviewdog_gitea_api_token"] + secrets: ["reviewdog_gitea_api_token", "gitea_address"] commands: | wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install mypy -- 2.43.0 From a089bbbf78e2e06701f7512403b1325d01b82b24 Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 19:09:06 +0100 Subject: [PATCH 13/39] =?UTF-8?q?=F0=9F=94=8A=20Print=20env=20variables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index 3013d98..2031a61 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -9,6 +9,7 @@ steps: failure: ignore secrets: ["reviewdog_gitea_api_token", "gitea_address"] commands: | + env wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install ruff ruff --output-format sarif . | ./bin/reviewdog -f=sarif -reporter=gitea-pr-review -tee -- 2.43.0 From 63abb677cbcb073279021696af638084202954c9 Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 19:13:13 +0100 Subject: [PATCH 14/39] =?UTF-8?q?=F0=9F=9A=A7=20Try=20to=20run=20linters?= =?UTF-8?q?=20on=20pull=5Frequest=20event?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index 2031a61..4f88ca9 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -1,5 +1,5 @@ when: - - event: push + - event: pull_request branch: exclude: [master, release/*] -- 2.43.0 From 812d7c0a61c0aeb3a052017d883a32ef76bbf58e Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 19:31:47 +0100 Subject: [PATCH 15/39] =?UTF-8?q?=F0=9F=9A=A7=20Format=20reviewdog=20comma?= =?UTF-8?q?nd=20and=20use=20temp=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index 4f88ca9..48ea39b 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -12,7 +12,10 @@ steps: env wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install ruff - ruff --output-format sarif . | ./bin/reviewdog -f=sarif -reporter=gitea-pr-review -tee + cd backend + ruff --output-format sarif . > /tmp/ruff.log + cat /tmp/ruff.log + cat /tmp/ruff.log | ./bin/reviewdog -f sarif -reporter gitea-pr-review - name: mypy image: python:3.12-alpine @@ -21,4 +24,5 @@ steps: commands: | wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install mypy - mypy . | ./bin/reviewdog -f=mypy -reporter=gitea-pr-review -tee + cd backend + mypy . | ./bin/reviewdog -f mypy -reporter gitea-pr-review -- 2.43.0 From 825a852c67c4ed033f241787c8f1bd061e26ec68 Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 19:34:51 +0100 Subject: [PATCH 16/39] =?UTF-8?q?=F0=9F=9A=A7=20Fix=20reviewdog=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index 48ea39b..7c2a9a8 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -9,10 +9,10 @@ steps: failure: ignore secrets: ["reviewdog_gitea_api_token", "gitea_address"] commands: | + cd backend env wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install ruff - cd backend ruff --output-format sarif . > /tmp/ruff.log cat /tmp/ruff.log cat /tmp/ruff.log | ./bin/reviewdog -f sarif -reporter gitea-pr-review @@ -22,7 +22,7 @@ steps: failure: ignore secrets: ["reviewdog_gitea_api_token", "gitea_address"] commands: | + cd backend wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install mypy - cd backend mypy . | ./bin/reviewdog -f mypy -reporter gitea-pr-review -- 2.43.0 From 63cdbcb46ec81ad4de5eacd19375742e5a7386b8 Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 19:46:12 +0100 Subject: [PATCH 17/39] =?UTF-8?q?=F0=9F=9A=A7=20Install=20dependencies=20b?= =?UTF-8?q?efore=20running=20the=20linters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 11 +++++------ backend/pyproject.toml | 25 +++++++++++++++---------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index 7c2a9a8..fbc15a1 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -10,12 +10,10 @@ steps: secrets: ["reviewdog_gitea_api_token", "gitea_address"] commands: | cd backend - env wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest - pip install ruff - ruff --output-format sarif . > /tmp/ruff.log - cat /tmp/ruff.log - cat /tmp/ruff.log | ./bin/reviewdog -f sarif -reporter gitea-pr-review + pip install poetry + poetry install --with=linters + ruff --output-format sarif . | ./bin/reviewdog -f sarif -reporter gitea-pr-review - name: mypy image: python:3.12-alpine @@ -24,5 +22,6 @@ steps: commands: | cd backend wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest - pip install mypy + pip install poetry + poetry install --with=linters mypy . | ./bin/reviewdog -f mypy -reporter gitea-pr-review diff --git a/backend/pyproject.toml b/backend/pyproject.toml index 83b33f4..f7fc067 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -49,27 +49,32 @@ pydantic-settings = "^2.0.3" requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" + [tool.poetry.group.dev.dependencies] pylsp-mypy = "^0.6.2" -mccabe = "^0.7.0" -rope = "^1.3.0" python-lsp-black = "^1.2.1" -black = "^22.10.0" -types-aiofiles = "^22.1.0.2" wrapt = "^1.14.1" -pydocstyle = "^6.2.2" dill = "^0.3.6" python-lsp-ruff = "^1.0.5" python-lsp-server = "^1.7.1" -autopep8 = "^2.0.1" -pyflakes = "^3.0.1" -yapf = "^0.32.0" -whatthepatch = "^1.0.4" -mypy = "^1.0.0" icecream = "^2.1.3" + + +[tool.poetry.group.linters.dependencies] +autopep8 = "^2.0.1" +black = "^22.10.0" +mccabe = "^0.7.0" +mypy = "^1.0.0" +pydocstyle = "^6.2.2" +pyflakes = "^3.0.1" +rope = "^1.3.0" +ruff = "^0.2.1" +types-aiofiles = "^22.1.0.2" types-sqlalchemy-utils = "^1.0.1" types-pyyaml = "^6.0.12.9" types-tqdm = "^4.65.0.1" +whatthepatch = "^1.0.4" +yapf = "^0.32.0" [tool.mypy] plugins = "sqlalchemy.ext.mypy.plugin" -- 2.43.0 From 2d9d7c51b50df23f7066993de89089a0a6aafd62 Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 19:52:34 +0100 Subject: [PATCH 18/39] =?UTF-8?q?=F0=9F=9A=A7=20Add=20gcc=20to=20the=20CI?= =?UTF-8?q?=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index fbc15a1..e9260ef 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -11,6 +11,7 @@ steps: commands: | cd backend wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest + apk add gcc pip install poetry poetry install --with=linters ruff --output-format sarif . | ./bin/reviewdog -f sarif -reporter gitea-pr-review -- 2.43.0 From 8082f7f012bec9346569b3951f2994e554ef363c Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 19:56:18 +0100 Subject: [PATCH 19/39] =?UTF-8?q?=F0=9F=9A=A7=20Remove=20the=20deps=20inst?= =?UTF-8?q?allation=20and=20disable=20mypy=20caching?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 7 +++---- backend/api/models/stop.py | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index e9260ef..a0f633c 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -11,9 +11,8 @@ steps: commands: | cd backend wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest - apk add gcc pip install poetry - poetry install --with=linters + poetry install --only=linters ruff --output-format sarif . | ./bin/reviewdog -f sarif -reporter gitea-pr-review - name: mypy @@ -24,5 +23,5 @@ steps: cd backend wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install poetry - poetry install --with=linters - mypy . | ./bin/reviewdog -f mypy -reporter gitea-pr-review + poetry install --only=linters + mypy --no-incremental . | ./bin/reviewdog -f mypy -reporter gitea-pr-review diff --git a/backend/api/models/stop.py b/backend/api/models/stop.py index 05e05e2..43c0a8d 100644 --- a/backend/api/models/stop.py +++ b/backend/api/models/stop.py @@ -35,6 +35,26 @@ if TYPE_CHECKING: logger = getLogger(__name__) +# import cProfile +# import io +# import pstats +# import contextlib + + +# @contextlib.contextmanager +# def profiled(): +# pr = cProfile.Profile() +# pr.enable() +# yield +# pr.disable() +# s = io.StringIO() +# ps = pstats.Stats(pr, stream=s).sort_stats("cumulative") +# ps.print_stats() +# # uncomment this to see who's calling what +# # ps.print_callers() +# print(s.getvalue()) + + class StopAreaStopAssociations(Base): id = mapped_column(BigInteger, primary_key=True) -- 2.43.0 From 2b0eb40ab159b2566a25c93c34a88c37b9a74eee Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 19:59:10 +0100 Subject: [PATCH 20/39] =?UTF-8?q?=F0=9F=9A=A7=20Run=20linters=20in=20poetr?= =?UTF-8?q?y=20virtual=20environment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index a0f633c..c0a493c 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -13,6 +13,7 @@ steps: wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install poetry poetry install --only=linters + poetry shell ruff --output-format sarif . | ./bin/reviewdog -f sarif -reporter gitea-pr-review - name: mypy @@ -24,4 +25,5 @@ steps: wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install poetry poetry install --only=linters + poetry shell mypy --no-incremental . | ./bin/reviewdog -f mypy -reporter gitea-pr-review -- 2.43.0 From 0993c42557facd234189382dba58d0e7fb58b751 Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 20:02:47 +0100 Subject: [PATCH 21/39] =?UTF-8?q?=F0=9F=9A=A7=20Poetry=20shell=20->=20poet?= =?UTF-8?q?ry=20run?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index c0a493c..e767bf8 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -13,8 +13,7 @@ steps: wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install poetry poetry install --only=linters - poetry shell - ruff --output-format sarif . | ./bin/reviewdog -f sarif -reporter gitea-pr-review + poetry run ruff --output-format sarif . | ./bin/reviewdog -f sarif -reporter gitea-pr-review - name: mypy image: python:3.12-alpine @@ -25,5 +24,4 @@ steps: wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install poetry poetry install --only=linters - poetry shell - mypy --no-incremental . | ./bin/reviewdog -f mypy -reporter gitea-pr-review + poetry run mypy --no-incremental . | ./bin/reviewdog -f mypy -reporter gitea-pr-review -- 2.43.0 From 688ffeb7f86c394b84ba9dd62882ad52392d25d7 Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 20:14:44 +0100 Subject: [PATCH 22/39] =?UTF-8?q?=F0=9F=9A=A7=20Add=20the=20sqlalchemy=20d?= =?UTF-8?q?ep=20to=20the=20linters=20poetry=20group?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 4 ++-- backend/pyproject.toml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index e767bf8..3a6d890 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -12,7 +12,7 @@ steps: cd backend wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install poetry - poetry install --only=linters + poetry install --only=linters --no-root poetry run ruff --output-format sarif . | ./bin/reviewdog -f sarif -reporter gitea-pr-review - name: mypy @@ -23,5 +23,5 @@ steps: cd backend wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install poetry - poetry install --only=linters + poetry install --only=linters --no-root poetry run mypy --no-incremental . | ./bin/reviewdog -f mypy -reporter gitea-pr-review diff --git a/backend/pyproject.toml b/backend/pyproject.toml index f7fc067..dee4a40 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -50,6 +50,7 @@ requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" + [tool.poetry.group.dev.dependencies] pylsp-mypy = "^0.6.2" python-lsp-black = "^1.2.1" @@ -60,6 +61,7 @@ python-lsp-server = "^1.7.1" icecream = "^2.1.3" + [tool.poetry.group.linters.dependencies] autopep8 = "^2.0.1" black = "^22.10.0" @@ -75,6 +77,7 @@ types-pyyaml = "^6.0.12.9" types-tqdm = "^4.65.0.1" whatthepatch = "^1.0.4" yapf = "^0.32.0" +sqlalchemy = "^2.0.26" [tool.mypy] plugins = "sqlalchemy.ext.mypy.plugin" -- 2.43.0 From 35882bda310bc4ca8da925a5ec782293f36b16ce Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 21:04:22 +0100 Subject: [PATCH 23/39] =?UTF-8?q?=F0=9F=94=8A=20Increase=20reviewdog=20log?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index 3a6d890..0e12c28 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -13,7 +13,7 @@ steps: wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install poetry poetry install --only=linters --no-root - poetry run ruff --output-format sarif . | ./bin/reviewdog -f sarif -reporter gitea-pr-review + poetry run ruff --output-format sarif . | ./bin/reviewdog -f sarif -reporter gitea-pr-review -log-level debug - name: mypy image: python:3.12-alpine @@ -22,6 +22,6 @@ steps: commands: | cd backend wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest - pip install poetry - poetry install --only=linters --no-root - poetry run mypy --no-incremental . | ./bin/reviewdog -f mypy -reporter gitea-pr-review + pip install poetry 2>&1 > /dev/null + poetry install --only=linters --no-root 2>&1 > /dev/null + poetry run mypy --no-incremental . | ./bin/reviewdog -f mypy -reporter gitea-pr-review -log-level debug -- 2.43.0 From 529315bf50cff4e796e8171936558f3f3df64c32 Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 21:31:23 +0100 Subject: [PATCH 24/39] =?UTF-8?q?=F0=9F=9A=A7=20Disable=20reviewdog=20filt?= =?UTF-8?q?er=20and=20create=20empty=20.reviewdog.yml=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index 0e12c28..b93b4d7 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -22,6 +22,7 @@ steps: commands: | cd backend wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest + touch .reviewdog.yml pip install poetry 2>&1 > /dev/null poetry install --only=linters --no-root 2>&1 > /dev/null - poetry run mypy --no-incremental . | ./bin/reviewdog -f mypy -reporter gitea-pr-review -log-level debug + poetry run mypy --no-incremental . | ./bin/reviewdog -f mypy -reporter gitea-pr-review -filter-mode nofilter -log-level debug -- 2.43.0 From 117d549ea7959a89af98d122ab11c674e895d0db Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 11 Feb 2024 21:38:46 +0100 Subject: [PATCH 25/39] =?UTF-8?q?=F0=9F=9A=A7=20Redirect=20reviewdog=20std?= =?UTF-8?q?err=20to=20stdout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index b93b4d7..b6a776a 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -25,4 +25,4 @@ steps: touch .reviewdog.yml pip install poetry 2>&1 > /dev/null poetry install --only=linters --no-root 2>&1 > /dev/null - poetry run mypy --no-incremental . | ./bin/reviewdog -f mypy -reporter gitea-pr-review -filter-mode nofilter -log-level debug + poetry run mypy --no-incremental . | ./bin/reviewdog -f mypy -reporter gitea-pr-review -filter-mode nofilter -log-level debug 2>&1 -- 2.43.0 From f964ba9027744714162727aad78f23884ef2dc4d Mon Sep 17 00:00:00 2001 From: Adrien Date: Mon, 12 Feb 2024 23:38:34 +0100 Subject: [PATCH 26/39] =?UTF-8?q?=F0=9F=9A=A7=20Add=20dummy=20commit=20to?= =?UTF-8?q?=20check=20the=20reviewdog=20filter=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/api_server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/api_server.py b/backend/api_server.py index c16b406..e156806 100755 --- a/backend/api_server.py +++ b/backend/api_server.py @@ -18,13 +18,14 @@ from api.routers import line, stop @asynccontextmanager -async def lifespan(app: FastAPI): +async def lifespan(app: FastAPI) -> None: FastAPICache.init(redis_backend, prefix="api", enable=settings.cache.enable) await db.connect(settings.db, settings.clear_static_data) if settings.clear_static_data: await idfm_interface.startup() + print("OK") yield await db.disconnect() -- 2.43.0 From fe05e2a2c5b4aba16d4f9b2b69c0170594ef052e Mon Sep 17 00:00:00 2001 From: Adrien Date: Tue, 13 Feb 2024 20:57:18 +0100 Subject: [PATCH 27/39] =?UTF-8?q?=F0=9F=8E=A8=20Factorize=20backend=20lint?= =?UTF-8?q?ers=20steps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index b6a776a..3e633de 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -3,26 +3,24 @@ when: branch: exclude: [master, release/*] +image: python:3.12-alpine + steps: - - name: ruff - image: python:3.12-alpine - failure: ignore - secrets: ["reviewdog_gitea_api_token", "gitea_address"] - commands: | - cd backend + - name: prepare + command: | wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install poetry + cd backend poetry install --only=linters --no-root - poetry run ruff --output-format sarif . | ./bin/reviewdog -f sarif -reporter gitea-pr-review -log-level debug - - name: mypy - image: python:3.12-alpine + - name: ruff failure: ignore secrets: ["reviewdog_gitea_api_token", "gitea_address"] commands: | - cd backend - wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest - touch .reviewdog.yml - pip install poetry 2>&1 > /dev/null - poetry install --only=linters --no-root 2>&1 > /dev/null - poetry run mypy --no-incremental . | ./bin/reviewdog -f mypy -reporter gitea-pr-review -filter-mode nofilter -log-level debug 2>&1 + poetry run ruff --output-format sarif . | ./bin/reviewdog -f sarif -reporter gitea-pr-review -filter-mode nofilter + + - name: mypy + failure: ignore + secrets: ["reviewdog_gitea_api_token", "gitea_address"] + commands: | + poetry run mypy --no-incremental . | ./bin/reviewdog -f mypy -reporter gitea-pr-review -filter-mode nofilter -- 2.43.0 From 221125198d0ed3ae6c3d1e8315e1eeabc2db7f40 Mon Sep 17 00:00:00 2001 From: Adrien Date: Tue, 13 Feb 2024 22:09:09 +0100 Subject: [PATCH 28/39] =?UTF-8?q?=F0=9F=90=9B=20Image=20shall=20be=20set?= =?UTF-8?q?=20for=20each=20CI=20step?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index 3e633de..531a197 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -3,10 +3,9 @@ when: branch: exclude: [master, release/*] -image: python:3.12-alpine - steps: - name: prepare + image: python:3.12-alpine command: | wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install poetry @@ -14,12 +13,14 @@ steps: poetry install --only=linters --no-root - name: ruff + image: python:3.12-alpine failure: ignore secrets: ["reviewdog_gitea_api_token", "gitea_address"] commands: | poetry run ruff --output-format sarif . | ./bin/reviewdog -f sarif -reporter gitea-pr-review -filter-mode nofilter - name: mypy + image: python:3.12-alpine failure: ignore secrets: ["reviewdog_gitea_api_token", "gitea_address"] commands: | -- 2.43.0 From fe67cd0d983cdc4d1011a018deadd2acd85ae328 Mon Sep 17 00:00:00 2001 From: Adrien Date: Tue, 13 Feb 2024 22:36:34 +0100 Subject: [PATCH 29/39] =?UTF-8?q?=F0=9F=9A=A7=20Dummy=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index 531a197..7fd56f5 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -8,6 +8,7 @@ steps: image: python:3.12-alpine command: | wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest + echo "test" pip install poetry cd backend poetry install --only=linters --no-root -- 2.43.0 From 85bdf2656cce6efb87b1f3a3d6bea9cdae206ab5 Mon Sep 17 00:00:00 2001 From: Adrien Date: Tue, 13 Feb 2024 22:56:45 +0100 Subject: [PATCH 30/39] =?UTF-8?q?=F0=9F=9A=A7=20Comment=20temporary=20the?= =?UTF-8?q?=20backend=20linter=20when=20conditions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index 7fd56f5..04683eb 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -1,14 +1,13 @@ -when: - - event: pull_request - branch: - exclude: [master, release/*] +# when: +# - event: pull_request +# branch: +# exclude: [master, release/*] steps: - name: prepare image: python:3.12-alpine command: | wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest - echo "test" pip install poetry cd backend poetry install --only=linters --no-root -- 2.43.0 From 30020d17cc4dfa1117cb63052cc45341ec9927c2 Mon Sep 17 00:00:00 2001 From: Adrien Date: Tue, 13 Feb 2024 23:02:40 +0100 Subject: [PATCH 31/39] =?UTF-8?q?=F0=9F=90=9B=20Fix=20typo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index 04683eb..a894a16 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -1,12 +1,12 @@ -# when: -# - event: pull_request -# branch: -# exclude: [master, release/*] +when: + - event: pull_request + branch: + exclude: [master, release/*] steps: - name: prepare image: python:3.12-alpine - command: | + commands: | wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install poetry cd backend -- 2.43.0 From f1cafc7484f2e2f669c91e646b7a67c8c648fdbb Mon Sep 17 00:00:00 2001 From: Adrien Date: Tue, 13 Feb 2024 23:05:45 +0100 Subject: [PATCH 32/39] =?UTF-8?q?=F0=9F=9A=A7=20Add=20dummy=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index a894a16..954af8c 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -7,6 +7,7 @@ steps: - name: prepare image: python:3.12-alpine commands: | + echo "Prepare linters environment" wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest pip install poetry cd backend -- 2.43.0 From d4d24d13d218767bb711632308cc8855b585c9f6 Mon Sep 17 00:00:00 2001 From: Adrien Date: Tue, 13 Feb 2024 23:39:46 +0100 Subject: [PATCH 33/39] =?UTF-8?q?=F0=9F=90=9B=20Install=20poetry=20for=20e?= =?UTF-8?q?ach=20step?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index 954af8c..79896f1 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -7,22 +7,24 @@ steps: - name: prepare image: python:3.12-alpine commands: | - echo "Prepare linters environment" wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest - pip install poetry - cd backend - poetry install --only=linters --no-root - name: ruff image: python:3.12-alpine failure: ignore secrets: ["reviewdog_gitea_api_token", "gitea_address"] commands: | - poetry run ruff --output-format sarif . | ./bin/reviewdog -f sarif -reporter gitea-pr-review -filter-mode nofilter + pip install poetry + cd backend + poetry install --only=linters --no-root + poetry run ruff --output-format sarif . | ../bin/reviewdog -f sarif -reporter gitea-pr-review -filter-mode nofilter - name: mypy image: python:3.12-alpine failure: ignore secrets: ["reviewdog_gitea_api_token", "gitea_address"] commands: | - poetry run mypy --no-incremental . | ./bin/reviewdog -f mypy -reporter gitea-pr-review -filter-mode nofilter + pip install poetry + cd backend + poetry install --only=linters --no-root + poetry run mypy --no-incremental . | ../bin/reviewdog -f mypy -reporter gitea-pr-review -filter-mode nofilter -- 2.43.0 From 001c7330c654eba384838d4a7b7d6c97708cddac Mon Sep 17 00:00:00 2001 From: Adrien Date: Wed, 14 Feb 2024 22:49:55 +0100 Subject: [PATCH 34/39] =?UTF-8?q?=F0=9F=8E=A8=20Prepare=20linters=20enviro?= =?UTF-8?q?nment=20once?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index 79896f1..a59fcdb 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -7,24 +7,28 @@ steps: - name: prepare image: python:3.12-alpine commands: | + python3 -m venv local + source ./local/bin/activate + export PATH="./local/bin:${PATH}" + cd ./local wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest + pip install poetry + poetry install --only=linters --no-root - name: ruff image: python:3.12-alpine failure: ignore secrets: ["reviewdog_gitea_api_token", "gitea_address"] commands: | - pip install poetry + export PATH="./local/bin:${PATH}" cd backend - poetry install --only=linters --no-root - poetry run ruff --output-format sarif . | ../bin/reviewdog -f sarif -reporter gitea-pr-review -filter-mode nofilter + poetry run ruff --output-format sarif . | reviewdog -f sarif -reporter gitea-pr-review -filter-mode nofilter - name: mypy image: python:3.12-alpine failure: ignore secrets: ["reviewdog_gitea_api_token", "gitea_address"] commands: | - pip install poetry + export PATH="./local/bin:${PATH}" cd backend - poetry install --only=linters --no-root - poetry run mypy --no-incremental . | ../bin/reviewdog -f mypy -reporter gitea-pr-review -filter-mode nofilter + poetry run mypy --no-incremental . | reviewdog -f mypy -reporter gitea-pr-review -filter-mode nofilter -- 2.43.0 From 06d446c3f9125cc318836508c4709511c58fe8f9 Mon Sep 17 00:00:00 2001 From: Adrien Date: Wed, 14 Feb 2024 22:58:04 +0100 Subject: [PATCH 35/39] =?UTF-8?q?=F0=9F=9A=A7=20Edit=20PATH=20before=20loa?= =?UTF-8?q?ding=20python=20virtual=20env?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index a59fcdb..4ac28c8 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -8,10 +8,10 @@ steps: image: python:3.12-alpine commands: | python3 -m venv local - source ./local/bin/activate - export PATH="./local/bin:${PATH}" cd ./local wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest + export PATH="${PWD}/local/bin:${PATH}" + source ./local/bin/activate pip install poetry poetry install --only=linters --no-root -- 2.43.0 From 99aeaae9f288e0768e5ee6ea43fb8cec799d8c36 Mon Sep 17 00:00:00 2001 From: Adrien Date: Wed, 14 Feb 2024 23:06:43 +0100 Subject: [PATCH 36/39] =?UTF-8?q?=F0=9F=9A=A7=20Skip=20the=20PATH=20update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index 4ac28c8..7d41cb7 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -10,8 +10,7 @@ steps: python3 -m venv local cd ./local wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest - export PATH="${PWD}/local/bin:${PATH}" - source ./local/bin/activate + source ./bin/activate pip install poetry poetry install --only=linters --no-root @@ -20,15 +19,11 @@ steps: failure: ignore secrets: ["reviewdog_gitea_api_token", "gitea_address"] commands: | - export PATH="./local/bin:${PATH}" - cd backend - poetry run ruff --output-format sarif . | reviewdog -f sarif -reporter gitea-pr-review -filter-mode nofilter + poetry run ruff --output-format sarif backend | ./local/bin/reviewdog -f sarif -reporter gitea-pr-review -filter-mode nofilter - name: mypy image: python:3.12-alpine failure: ignore secrets: ["reviewdog_gitea_api_token", "gitea_address"] commands: | - export PATH="./local/bin:${PATH}" - cd backend - poetry run mypy --no-incremental . | reviewdog -f mypy -reporter gitea-pr-review -filter-mode nofilter + poetry run mypy --no-incremental backend | ./local/bin/reviewdog -f mypy -reporter gitea-pr-review -filter-mode nofilter -- 2.43.0 From 71f7519b2f621430309a4aabbdc70b35cdb967ef Mon Sep 17 00:00:00 2001 From: Adrien Date: Wed, 14 Feb 2024 23:10:26 +0100 Subject: [PATCH 37/39] =?UTF-8?q?=F0=9F=90=9B=20Fix=20invalid=20running=20?= =?UTF-8?q?directory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index 7d41cb7..93be03a 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -10,7 +10,8 @@ steps: python3 -m venv local cd ./local wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest - source ./bin/activate + cd - + source ./local/bin/activate pip install poetry poetry install --only=linters --no-root -- 2.43.0 From 94d87c1c0ec4d4f6d134e29d8aab2b046db5a91e Mon Sep 17 00:00:00 2001 From: Adrien Date: Wed, 14 Feb 2024 23:24:16 +0100 Subject: [PATCH 38/39] =?UTF-8?q?=F0=9F=90=9B=20Fix=20invalid=20running=20?= =?UTF-8?q?directory=20(part=202)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index 93be03a..bda9507 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -7,10 +7,9 @@ steps: - name: prepare image: python:3.12-alpine commands: | + cd ./backend python3 -m venv local - cd ./local - wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest - cd - + wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest -b ./local/bin/ source ./local/bin/activate pip install poetry poetry install --only=linters --no-root @@ -20,11 +19,13 @@ steps: failure: ignore secrets: ["reviewdog_gitea_api_token", "gitea_address"] commands: | - poetry run ruff --output-format sarif backend | ./local/bin/reviewdog -f sarif -reporter gitea-pr-review -filter-mode nofilter + cd ./backend + poetry run ruff --output-format sarif . | ./local/bin/reviewdog -f sarif -reporter gitea-pr-review -filter-mode nofilter - name: mypy image: python:3.12-alpine failure: ignore secrets: ["reviewdog_gitea_api_token", "gitea_address"] commands: | - poetry run mypy --no-incremental backend | ./local/bin/reviewdog -f mypy -reporter gitea-pr-review -filter-mode nofilter + cd ./backend + poetry run mypy --no-incremental . | ./local/bin/reviewdog -f mypy -reporter gitea-pr-review -filter-mode nofilter -- 2.43.0 From ce671f4b10da246856d3eef6de012595943c6ae5 Mon Sep 17 00:00:00 2001 From: Adrien Date: Wed, 14 Feb 2024 23:28:49 +0100 Subject: [PATCH 39/39] =?UTF-8?q?=F0=9F=90=9B=20Enable=20virtual=20env=20b?= =?UTF-8?q?efore=20running=20poetry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.woodpecker/.lint.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/.woodpecker/.lint.yaml b/backend/.woodpecker/.lint.yaml index bda9507..65b3c04 100644 --- a/backend/.woodpecker/.lint.yaml +++ b/backend/.woodpecker/.lint.yaml @@ -20,6 +20,7 @@ steps: secrets: ["reviewdog_gitea_api_token", "gitea_address"] commands: | cd ./backend + source ./local/bin/activate poetry run ruff --output-format sarif . | ./local/bin/reviewdog -f sarif -reporter gitea-pr-review -filter-mode nofilter - name: mypy @@ -28,4 +29,5 @@ steps: secrets: ["reviewdog_gitea_api_token", "gitea_address"] commands: | cd ./backend + source ./local/bin/activate poetry run mypy --no-incremental . | ./local/bin/reviewdog -f mypy -reporter gitea-pr-review -filter-mode nofilter -- 2.43.0