Skip to content

Commit 929cc22

Browse files
linting fixes
1 parent a5a70da commit 929cc22

4 files changed

Lines changed: 12 additions & 6 deletions

File tree

src/eligibility_signposting_api/logging/logs_manager.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,14 @@ def wrapper(event: LambdaEvent, context: LambdaContext) -> dict[str, Any] | None
3030

3131

3232
class EnrichedJsonFormatter(JsonFormatter):
33-
def add_fields(self, log_data: dict[str, Any], record: logging.LogRecord, message_dict: dict[str, Any]) -> None:
34-
log_data["request_id"] = request_id_context_var.get() or "-"
35-
super().add_fields(log_data, record, message_dict)
33+
def add_fields(
34+
self,
35+
log_record: dict[str, Any],
36+
record: logging.LogRecord,
37+
message_dict: dict[str, Any],
38+
) -> None:
39+
log_record["request_id"] = request_id_context_var.get() or "-"
40+
super().add_fields(log_record, record, message_dict)
3641

3742

3843
def init_logging(quieten: Sequence[str] = ("asyncio", "botocore", "boto3", "mangum", "urllib3")) -> None:

src/eligibility_signposting_api/model/campaign_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class IterationRule(BaseModel):
158158
model_config = {"populate_by_name": True, "extra": "ignore"}
159159

160160
@field_validator("rule_stop", mode="before")
161-
def parse_yn_to_bool(cls, v: str | bool) -> bool: # noqa: N805, FBT001
161+
def parse_yn_to_bool(cls, v: str | bool) -> bool: # noqa: N805
162162
if isinstance(v, str):
163163
return v.upper() == "Y"
164164
return v

src/rules_validation_api/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ def main() -> None:
5151
json_data = json.load(file)
5252
result = RulesValidation(**json_data)
5353
sys.stdout.write(f"{GREEN}Valid Config{RESET}\n")
54-
sys.stdout.write(f"{COLON_COLOR}Current Iteration Number is {RESET}{RIGHT_COLOR}"
54+
sys.stdout.write(
55+
f"{COLON_COLOR}Current Iteration Number is {RESET}{RIGHT_COLOR}"
5556
f"{result.campaign_config.current_iteration.iteration_number}{RESET}\n"
5657
)
5758

tests/integration/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def iam_role(iam_client: BaseClient) -> Generator[str]:
228228

229229
@pytest.fixture(scope="session")
230230
def lambda_zip() -> Path:
231-
build_result = subprocess.run(["make", "build"], capture_output=True, text=True, check=False) # noqa: S607
231+
build_result = subprocess.run(["make", "build"], capture_output=True, text=True, check=False) # noqa: S603, S607
232232
assert build_result.returncode == 0, f"'make build' failed: {build_result.stderr}"
233233
return Path("dist/lambda.zip")
234234

0 commit comments

Comments
 (0)