Skip to content

Commit b6cdd73

Browse files
committed
update makefiles for lint
1 parent a91d957 commit b6cdd73

File tree

8 files changed

+18
-27
lines changed

8 files changed

+18
-27
lines changed

request-api/makefile

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
test: lint test-coverage
22

3-
lint::
4-
make black ./src
5-
python -m flake8 ./src
3+
lint: black-check flake8
64

7-
black-check:
8-
black --check .
5+
black-check:
6+
python -m black --check ./src ./tests
97

10-
black:
11-
black .
8+
flake8:
9+
python -m flake8 ./src ./tests
1210

13-
flake8:
14-
flake8 .
11+
black:
12+
python -m black .
1513

1614
test-coverage:: coverage-unit coverage-integration coverage-acceptance
1715

request-processor/makerules/python.mk

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
all:: lint test-coverage
22

3-
lint:
4-
make black ./src/application
5-
python -m flake8 ./src/application
3+
lint: black-check flake8
64

7-
black-check:
8-
black --check .
5+
black-check:
6+
python -m black --check ./src ./tests
7+
8+
flake8:
9+
python -m flake8 ./src ./tests
910

1011
black:
1112
python -m black .

request-processor/src/tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def handle_check_file(request_schema, request_data, tmp_dir):
141141

142142

143143
@celery.task(base=CheckDataUrlTask, name=CheckDataUrlTask.name)
144-
def check_dataurl(request: Dict, directories=None):
144+
def check_dataurl(request: Dict, directories=None): # noqa
145145
logger.info(
146146
f"Started check_dataurl task for request_id = {request.get('id', 'unknown')}"
147147
)

request-processor/tests/integration/src/test_tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def test_check_datafile(
9999
"https://example.com/arcgis/rest/services/MapServer",
100100
(
101101
None,
102-
'{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"name":"Test Feature"}}]}'.encode(
102+
'{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"name":"Test Feature"}}]}'.encode( # noqa: E501
103103
"utf-8"
104104
),
105105
),

request-processor/tests/unit/src/application/core/test_pipeline.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import pytest
2-
import os
3-
import csv
42
from unittest.mock import MagicMock
53
from src.application.core.pipeline import (
64
fetch_add_data_response,

request-processor/tests/unit/src/application/core/test_utils.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,6 @@ def test_validate_endpoint_csv_read_error(monkeypatch, tmp_path):
357357
"""Test validate_endpoint when reading CSV fails"""
358358
pipeline_dir = tmp_path / "pipeline"
359359
pipeline_dir.mkdir()
360-
url = "http://example.com/endpoint"
361-
362360
endpoint_csv_path = pipeline_dir / "endpoint.csv"
363361
endpoint_csv_path.write_bytes(b"\x00\x00\x00")
364362

@@ -380,7 +378,6 @@ def test_validate_source_creates_new_source(monkeypatch, tmp_path):
380378
"""Test validate_source creates new source entry when it doesn't exist"""
381379
pipeline_dir = tmp_path / "pipeline"
382380
pipeline_dir.mkdir()
383-
source_csv_path = pipeline_dir / "source.csv"
384381

385382
documentation_url = "http://example.com/doc"
386383
collection = "test-collection"

request-processor/tests/unit/src/application/core/test_workflow.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
fetch_pipeline_csvs,
77
add_data_workflow,
88
fetch_add_data_pipeline_csvs,
9-
fetch_add_data_collection_csvs,
109
)
1110
import csv
1211
import hashlib
1312
import os
1413
from pathlib import Path
15-
import urllib
1614
from urllib.error import HTTPError
1715

1816

request-processor/tests/unit/src/test_tasks.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
import pytest
44
import json
55
from src import tasks
6-
from src.tasks import save_response_to_db, _fetch_resource, check_dataurl
6+
from src.tasks import save_response_to_db, check_dataurl
77
from request_model import models, schemas
8-
from unittest.mock import patch, MagicMock
8+
from unittest.mock import MagicMock
99
from application.exceptions.customExceptions import CustomException
10-
from application.configurations.config import Directories
1110

1211

1312
@pytest.mark.parametrize(
@@ -640,7 +639,7 @@ def mock_run_workflow(
640639
tasks, "_get_request", lambda rid: {"id": rid, "status": "COMPLETE"}
641640
)
642641

643-
result = check_dataurl(request, directories_json)
642+
check_dataurl(request, directories_json)
644643

645644
assert len(workflow_calls) == 1
646645
assert workflow_calls[0]["file_name"] == "brownfield-data.csv"

0 commit comments

Comments
 (0)