Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mahesh-naxa committed May 2, 2024
1 parent 3e45ab3 commit 1b5bb0e
Show file tree
Hide file tree
Showing 82 changed files with 141 additions and 15 deletions.
48 changes: 48 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
repos:
# Versioning: Commit messages & changelog
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.13.0
hooks:
- id: commitizen
stages: [commit-msg]

- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
language_version: python3.9

# Lint / autoformat: Python code
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: "v0.4.2"
hooks:
# Run the linter
- id: ruff
files: ^backend/(?:.*/)*.*$
args: [--fix, --exit-non-zero-on-fix]
# Run the formatter
- id: ruff-format
files: ^backend/(?:.*/)*.*$

# INFO: Searches for code that is used or lingering around. (Disabled since there were a lot of work from dev end to remove stuff)
# - repo: https://github.com/asottile/dead
# rev: v1.5.2
# hooks:
# - id: dead

# Autoformat: YAML, JSON, Markdown, etc. (Disabled since pre-commit wasn't able to fix and needs dev input)
# - repo: https://github.com/pre-commit/mirrors-prettier
# rev: v3.1.0
# hooks:
# - id: prettier
# args:
# [
# --ignore-unknown,
# --no-error-on-unmatched-pattern,
# "!chart/**",
# "!CHANGELOG.md",
# "!CONTRIBUTING.md",
# "!frontend/pnpm-lock.yaml",
# "!backend/tests/test_data/**",
# ]
4 changes: 2 additions & 2 deletions backend/models/postgis/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def get_all_organisations():
)

dto = TagsDTO()
dto.tags = [r for r, in result]
dto.tags = [r for (r,) in result]
return dto

@staticmethod
Expand All @@ -58,5 +58,5 @@ def get_all_campaigns():
result = db.session.query(Tags.campaigns).filter(Tags.campaigns.isnot(None))

dto = TagsDTO()
dto.tags = [r for r, in result]
dto.tags = [r for (r,) in result]
return dto
12 changes: 6 additions & 6 deletions backend/services/stats_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,12 @@ def get_user_contributions(project_id: int) -> ProjectContributionsDTO:
validated=r.validated,
total=r.total,
mapped_tasks=r.mapped_tasks if r.mapped_tasks is not None else [],
bad_imagery_tasks=r.bad_imagery_tasks
if r.bad_imagery_tasks
else [],
validated_tasks=r.validated_tasks
if r.validated_tasks is not None
else [],
bad_imagery_tasks=(
r.bad_imagery_tasks if r.bad_imagery_tasks else []
),
validated_tasks=(
r.validated_tasks if r.validated_tasks is not None else []
),
date_registered=r.date_registered.date(),
)
)
Expand Down
1 change: 1 addition & 0 deletions migrations/versions/05e1ecf9953a_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-12-04 19:53:41.477085
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/05f1b650ddbc_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-08-17 15:58:37.118728
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/068674f06b0f_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-10-02 08:45:00.553060
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/0a6b82b55983_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-09-04 19:09:45.866336
"""

from alembic import op
import sqlalchemy as sa
import re
Expand Down
1 change: 1 addition & 0 deletions migrations/versions/0aaac86a48dc_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2017-05-01 14:04:16.188885
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/0d47c10c8a66_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-01-13 20:51:12.809062
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/0eeaa5aed53b_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-06-26 17:31:17.238355
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/0eee8c1abd3a_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-05-24 23:05:45.512395
"""

from alembic import op
from sqlalchemy.dialects.postgresql import ARRAY
import sqlalchemy as sa
Expand Down
1 change: 1 addition & 0 deletions migrations/versions/14340f1e0d6b_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2020-03-13 10:35:57.594664
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/14842761654b_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2020-11-11 07:18:58.675778
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/1579d24928e7_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2020-05-29 09:55:16.565573
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/22e7d7e0fa02_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-08-06 15:31:03.973448
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/22e9a0e9b254_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-11-21 04:20:16.572298
"""

from alembic import op


Expand Down
1 change: 1 addition & 0 deletions migrations/versions/251a7638da78_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-08-30 07:46:49.074078
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/29097876c7e6_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-12-04 11:21:42.622908
"""

from alembic import op


Expand Down
1 change: 1 addition & 0 deletions migrations/versions/2cfa981c70e7_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2020-07-16 10:30:59.885956
"""

from alembic import op
import geoalchemy2

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/2d6a7ad4e1eb_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2020-03-23 12:10:20.120500
"""

from alembic import op


Expand Down
1 change: 1 addition & 0 deletions migrations/versions/2ee4bca188a9_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2021-03-12 09:42:54.198713
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/30b091260689_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-07-30 12:52:52.845202
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/3b8b0956b217_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-07-27 10:30:55.193989
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/3ee58dee57c9_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2018-08-24 13:55:32.308278
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/42c45e74752b_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-03-29 09:07:55.771834
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/451f6bd05a19_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-07-02 17:03:55.567940
"""

from alembic import op


Expand Down
1 change: 1 addition & 0 deletions migrations/versions/48c3aed123cf_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2017-05-01 12:09:36.887823
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/4b9fb4d3f349_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-07-19 13:38:08.010157
"""

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
Expand Down
1 change: 1 addition & 0 deletions migrations/versions/4ed992117718_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-09-20 13:11:54.721669
"""

from alembic import op
import sqlalchemy as sa
from backend.models.postgis.statuses import TeamJoinMethod, TeamVisibility
Expand Down
1 change: 1 addition & 0 deletions migrations/versions/51ccc46f1b8a_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-10-16 19:30:51.064696
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/55790eeec3bf_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2020-05-12 18:43:37.666725
"""

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
Expand Down
1 change: 1 addition & 0 deletions migrations/versions/567b75e74955_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2017-06-02 17:18:52.374843
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/5952780a577e_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2020-06-11 16:58:45.700192
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/5eba4824505e_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-10-22 14:17:35.925047
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/64b682d53e23_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2017-06-06 16:53:47.604019
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/6612e4d6524c_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-08-19 21:40:06.669352
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/7435b0a865e6_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-08-20 08:54:12.215666
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/772aff899389_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2019-11-08 19:09:46.152809
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/7937dae319b5_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2020-09-21 17:17:10.542429
"""

from alembic import op
import sqlalchemy as sa
import requests
Expand Down
1 change: 1 addition & 0 deletions migrations/versions/7991a7e1b88d_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2017-05-30 17:19:55.061108
"""

from alembic import op
import sqlalchemy as sa

Expand Down
1 change: 1 addition & 0 deletions migrations/versions/7bbc01082457_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2020-01-29 11:19:20.113089
"""

from alembic import op
import sqlalchemy as sa
import sys
Expand Down
1 change: 1 addition & 0 deletions migrations/versions/7d55a089b5bc_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2017-06-26 17:22:12.828934
"""

from alembic import op
import sqlalchemy as sa

Expand Down
Loading

0 comments on commit 1b5bb0e

Please sign in to comment.