Skip to content

Commit

Permalink
Merge pull request #547 from nationalarchives/renovate/psf-black-24.x
Browse files Browse the repository at this point in the history
Update pre-commit hook psf/black to v24
  • Loading branch information
jacksonj04 authored Jan 31, 2024
2 parents bb92dc9 + fb989b0 commit 46cafbd
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
- id: check-yaml

- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black

Expand Down
29 changes: 15 additions & 14 deletions src/caselawclient/models/neutral_citation_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,21 @@ class NeutralCitationMixin:
"""

def __init__(self, document_noun: str, *args: Any, **kwargs: Any) -> None:
self.attributes_to_validate: list[
tuple[str, bool, str]
] = self.attributes_to_validate + [
(
"has_ncn",
True,
f"This {document_noun} has no neutral citation number",
),
(
"has_valid_ncn",
True,
f"The neutral citation number of this {document_noun} is not valid",
),
]
self.attributes_to_validate: list[tuple[str, bool, str]] = (
self.attributes_to_validate
+ [
(
"has_ncn",
True,
f"This {document_noun} has no neutral citation number",
),
(
"has_valid_ncn",
True,
f"The neutral citation number of this {document_noun} is not valid",
),
]
)

super(NeutralCitationMixin, self).__init__(*args, **kwargs)

Expand Down
6 changes: 2 additions & 4 deletions src/caselawclient/models/utilities/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ class ParserInstructionsDict(TypedDict):


@overload
def create_aws_client(service: Literal["s3"]) -> S3Client:
...
def create_aws_client(service: Literal["s3"]) -> S3Client: ...


@overload
def create_aws_client(service: Literal["sns"]) -> SNSClient:
...
def create_aws_client(service: Literal["sns"]) -> SNSClient: ...


def create_aws_client(service: Union[Literal["s3"], Literal["sns"]]) -> Any:
Expand Down
6 changes: 3 additions & 3 deletions tests/models/test_documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ def test_document_versions_happy_case(self, mock_api_client):
{"uri": "test/1234_xml_versions/2-1234.xml"},
{"uri": "test/1234_xml_versions/1-1234.xml"},
]
version_document.versions_as_documents[
0
].uri = "test/1234_xml_versions/2-1234.xml"
version_document.versions_as_documents[0].uri = (
"test/1234_xml_versions/2-1234.xml"
)

def test_document_version_number_when_not_version(self, mock_api_client):
base_document = Document("test/1234", mock_api_client)
Expand Down

0 comments on commit 46cafbd

Please sign in to comment.