Skip to content

Commit b80ec22

Browse files
committed
some more rules
1 parent aa1bef3 commit b80ec22

7 files changed

Lines changed: 53 additions & 21 deletions

File tree

app/presentation/adminapi/interface.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -338,49 +338,49 @@ class SetCrossmatchResultsResponse(pydantic.BaseModel):
338338

339339
class Actions(abc.ABC):
340340
@abc.abstractmethod
341-
def add_data(self, request: AddDataRequest) -> AddDataResponse:
341+
def add_data(self, r: AddDataRequest) -> AddDataResponse:
342342
pass
343343

344344
@abc.abstractmethod
345-
def create_table(self, request: CreateTableRequest) -> tuple[CreateTableResponse, bool]:
345+
def create_table(self, r: CreateTableRequest) -> tuple[CreateTableResponse, bool]:
346346
pass
347347

348348
@abc.abstractmethod
349-
def get_table(self, request: GetTableRequest) -> GetTableResponse:
349+
def get_table(self, r: GetTableRequest) -> GetTableResponse:
350350
pass
351351

352352
@abc.abstractmethod
353-
def get_table_list(self, request: GetTableListRequest) -> GetTableListResponse:
353+
def get_table_list(self, r: GetTableListRequest) -> GetTableListResponse:
354354
pass
355355

356356
@abc.abstractmethod
357-
def patch_table(self, request: PatchTableRequest) -> PatchTableResponse:
357+
def patch_table(self, r: PatchTableRequest) -> PatchTableResponse:
358358
pass
359359

360360
@abc.abstractmethod
361-
def create_source(self, request: CreateSourceRequest) -> CreateSourceResponse:
361+
def create_source(self, r: CreateSourceRequest) -> CreateSourceResponse:
362362
pass
363363

364364
@abc.abstractmethod
365-
def login(self, request: LoginRequest) -> LoginResponse:
365+
def login(self, r: LoginRequest) -> LoginResponse:
366366
pass
367367

368368
@abc.abstractmethod
369-
def get_records(self, request: GetRecordsRequest) -> GetRecordsResponse:
369+
def get_records(self, r: GetRecordsRequest) -> GetRecordsResponse:
370370
pass
371371

372372
@abc.abstractmethod
373-
def get_crossmatch_records(self, request: GetRecordsCrossmatchRequest) -> GetRecordsCrossmatchResponse:
373+
def get_crossmatch_records(self, r: GetRecordsCrossmatchRequest) -> GetRecordsCrossmatchResponse:
374374
pass
375375

376376
@abc.abstractmethod
377-
def get_record_crossmatch(self, request: GetRecordCrossmatchRequest) -> GetRecordCrossmatchResponse:
377+
def get_record_crossmatch(self, r: GetRecordCrossmatchRequest) -> GetRecordCrossmatchResponse:
378378
pass
379379

380380
@abc.abstractmethod
381-
def save_structured_data(self, request: SaveStructuredDataRequest) -> SaveStructuredDataResponse:
381+
def save_structured_data(self, r: SaveStructuredDataRequest) -> SaveStructuredDataResponse:
382382
pass
383383

384384
@abc.abstractmethod
385-
def set_crossmatch_results(self, request: SetCrossmatchResultsRequest) -> SetCrossmatchResultsResponse:
385+
def set_crossmatch_results(self, r: SetCrossmatchResultsRequest) -> SetCrossmatchResultsResponse:
386386
pass

pyproject.toml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ test = [
5454
"testcontainers-postgres>=0.0.1rc1",
5555
]
5656

57+
[tool.uv]
58+
config-settings = { editable_mode = "compat" }
59+
5760
[tool.pytest.ini_options]
5861
pythonpath = ["."]
5962
addopts = "-W ignore::DeprecationWarning"
@@ -100,7 +103,36 @@ select = [
100103

101104
[tool.basedpyright]
102105
typeCheckingMode = "off"
106+
venvPath = "."
107+
venv = ".venv"
108+
109+
### warns
110+
reportDeprecated = "warning"
111+
reportIncompatibleMethodOverride = "warning"
112+
113+
### pyright issues
114+
reportGeneralTypeIssues = "error"
115+
reportFunctionMemberAccess = "error"
116+
reportMissingImports = "error"
117+
reportMissingModuleSource = "error"
118+
reportInvalidTypeForm = "error"
119+
reportUnusedImport = "error"
120+
reportUnusedClass = "error"
121+
reportUnusedFunction = "error"
122+
reportUnusedVariable = "error"
123+
reportDuplicateImport = "error"
124+
reportWildcardImportFromLibrary = "error"
125+
reportAbstractUsage = "error"
126+
reportAssertTypeFailure = "error"
127+
reportCallIssue = "error"
128+
reportInconsistentOverload = "error"
129+
reportIndexIssue = "error"
130+
reportInvalidTypeArguments = "error"
131+
reportNoOverloadImplementation = "error"
132+
reportRedeclaration = "error"
133+
reportConstantRedefinition = "error"
103134

135+
### based pyright issues
104136
reportUnreachable = "error"
105137
reportIgnoreCommentWithoutRule = "error"
106138
reportImplicitRelativeImport = "error"

tests/integration/create_table_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def test_create_table(self):
3232
presentation.CreateSourceRequest(title="title", authors=["author"], year=2022)
3333
).code
3434

35-
response, created = self.upload_manager.create_table(
35+
self.upload_manager.create_table(
3636
presentation.CreateTableRequest(
3737
table_name="table_name",
3838
columns=[
@@ -61,7 +61,7 @@ def test_create_table_with_patch(self):
6161
).code
6262
table_name = "table_name"
6363

64-
response, created = self.upload_manager.create_table(
64+
_, created = self.upload_manager.create_table(
6565
presentation.CreateTableRequest(
6666
table_name=table_name,
6767
columns=[

tests/integration/rawdata_table_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_create_table_happy_case(self):
4242
],
4343
)
4444

45-
table_resp, _ = self.manager.create_table(
45+
self.manager.create_table(
4646
presentation.CreateTableRequest(
4747
table_name="test_table",
4848
columns=[
@@ -90,7 +90,7 @@ def test_create_table_with_nulls(self):
9090
],
9191
)
9292

93-
table_resp, _ = self.manager.create_table(
93+
self.manager.create_table(
9494
presentation.CreateTableRequest(
9595
table_name="test_table",
9696
columns=[
@@ -171,7 +171,7 @@ def test_add_data_to_unknown_column(self):
171171
],
172172
)
173173

174-
table_resp, _ = self.manager.create_table(
174+
self.manager.create_table(
175175
presentation.CreateTableRequest(
176176
table_name="test_table",
177177
columns=[

tests/unit/data/layer0_repository_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def setUp(self) -> None:
5454
def test_fetch_raw_data(self, _: str, kwargs: dict, expected_query: str):
5555
lib.returns(self.storage_mock.query, {"haha": [1, 2]})
5656

57-
_ = self.repo.fetch_raw_data("ironman", **kwargs)
57+
self.repo.fetch_raw_data("ironman", **kwargs)
5858
args, _ = self.storage_mock.query.call_args
5959

6060
actual = normalize_query(args[0])

tests/unit/domain/table_upload_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def test_create_table(
131131

132132
if err_substr is not None:
133133
with self.assertRaises(errors.RuleValidationError) as err:
134-
_, _ = self.manager.create_table(request)
134+
self.manager.create_table(request)
135135

136136
self.assertIn(err_substr, err.exception.message())
137137
else:
@@ -251,7 +251,7 @@ def test_mapping(
251251
):
252252
if err_substr:
253253
with self.assertRaises(errors.RuleValidationError) as err:
254-
_ = domain_descriptions_to_data(input_columns)
254+
domain_descriptions_to_data(input_columns)
255255

256256
self.assertIn(err_substr, err.exception.message())
257257
else:

tests/unit/lib/astronomy_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def test_apex_velocity(
113113
)
114114
def test_apex_velocity_with_uncertainties(
115115
self,
116-
_: str, # test name
116+
_: str,
117117
vel,
118118
lon,
119119
lat,

0 commit comments

Comments
 (0)