Skip to content

Commit

Permalink
Update var names to avoid unused argument errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ehanson8 committed Jan 31, 2024
1 parent 2719b42 commit 106d5f7
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 21 deletions.
4 changes: 2 additions & 2 deletions transmogrifier/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


def check_range(
instance: "Date", attribute: "attrs.Attribute", value: "DateRange" # noqa: ARG001
_instance: "Date", attribute: "attrs.Attribute", value: "DateRange"
) -> None:
if value is None:
return
Expand Down Expand Up @@ -36,7 +36,7 @@ def list_of(item_type: Any) -> Callable: # noqa: ANN401


def not_empty(
instance: "TimdexRecord", attribute: "attrs.Attribute", value: "list" # noqa: ARG001
_instance: "TimdexRecord", attribute: "attrs.Attribute", value: "list"
) -> None:
if len(value) == 0:
message = f"'{attribute.name}' cannot be an empty list, received: '{value}'."
Expand Down
2 changes: 1 addition & 1 deletion transmogrifier/sources/json/aardvark.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def get_timdex_record_id(
cls,
source: str,
source_record_id: str,
source_record: dict[str, JSON], # noqa: ARG003
_source_record: dict[str, JSON],
) -> str:
"""
Class method to set the TIMDEX record id.
Expand Down
20 changes: 8 additions & 12 deletions transmogrifier/sources/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,7 @@ def record_is_deleted(cls, source_record: dict[str, JSON] | Tag) -> bool:
source_record: A single source record.
"""

def get_optional_fields(
self, source_record: dict[str, JSON] | Tag # noqa: ARG002
) -> dict | None:
def get_optional_fields(self, _source_record: dict[str, JSON] | Tag) -> dict | None:
"""
Retrieve optional TIMDEX fields from a source record.
Expand Down Expand Up @@ -443,7 +441,7 @@ def get_source_link(
cls,
source_base_url: str,
source_record_id: str,
source_record: dict[str, JSON], # noqa: ARG003
_source_record: dict[str, JSON],
) -> str:
"""
Class method to set the source link for the item.
Expand All @@ -466,7 +464,7 @@ def get_timdex_record_id(
cls,
source: str,
source_record_id: str,
source_record: dict[str, JSON], # noqa: ARG003
_source_record: dict[str, JSON],
) -> str:
"""
Class method to set the TIMDEX record id.
Expand Down Expand Up @@ -508,9 +506,7 @@ def record_is_deleted(cls, source_record: dict[str, JSON]) -> bool:
source_record: A JSON object representing a source record.
"""

def get_optional_fields(
self, source_record: dict[str, JSON] # noqa: ARG002
) -> dict | None:
def get_optional_fields(self, _source_record: dict[str, JSON]) -> dict | None:
"""
Retrieve optional TIMDEX fields from a JSON record.
Expand Down Expand Up @@ -589,7 +585,7 @@ def get_required_fields(self, source_record: Tag) -> dict:
}

@classmethod
def get_main_titles(cls, source_record: Tag) -> list[Tag]: # noqa: ARG003
def get_main_titles(cls, _source_record: Tag) -> list[Tag]:
"""
Retrieve main title(s) from an XML record.
Expand All @@ -605,7 +601,7 @@ def get_source_link(
cls,
source_base_url: str,
source_record_id: str,
source_record: Tag, # noqa: ARG003
_source_record: Tag,
) -> str:
"""
Class method to set the source link for the item.
Expand All @@ -625,7 +621,7 @@ def get_source_link(

@classmethod
def get_timdex_record_id(
cls, source: str, source_record_id: str, source_record: Tag # noqa: ARG003
cls, source: str, source_record_id: str, _source_record: Tag
) -> str:
"""
Class method to set the TIMDEX record id.
Expand Down Expand Up @@ -669,7 +665,7 @@ def record_is_deleted(cls, source_record: Tag) -> bool:
return True
return False

def get_optional_fields(self, source_record: Tag) -> dict | None: # noqa: ARG002
def get_optional_fields(self, _source_record: Tag) -> dict | None:
"""
Retrieve optional TIMDEX fields from an XML record.
Expand Down
2 changes: 1 addition & 1 deletion transmogrifier/sources/xml/datacite.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def generate_related_item_identifier_url(cls, related_item_identifier: Tag) -> s
return base_url + related_item_identifier.string

@classmethod
def valid_content_types(cls, content_type_list: list[str]) -> bool: # noqa: ARG003
def valid_content_types(cls, _content_type_list: list[str]) -> bool:
"""
Validate a list of content_type values from a Datacite XML record.
Expand Down
2 changes: 1 addition & 1 deletion transmogrifier/sources/xml/dspace_dim.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def get_source_record_id(cls, xml: Tag) -> str:
return xml.header.identifier.string.split(":")[2]

@classmethod
def valid_content_types(cls, content_type_list: list[str]) -> bool: # noqa: ARG003
def valid_content_types(cls, _content_type_list: list[str]) -> bool:
"""
Validate a list of content_type values from a DSpace DIM XML record.
Expand Down
4 changes: 1 addition & 3 deletions transmogrifier/sources/xml/oaidc.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ def get_dates(self, source_record_id: str, xml: Tag) -> list[timdex.Date]:
dates.append(timdex.Date(value=date_str, kind="Unknown"))
return dates

def get_links(
self, source_record_id: str, xml: Tag # noqa: ARG002
) -> list[timdex.Link] | None:
def get_links(self, _source_record_id: str, _xml: Tag) -> list[timdex.Link] | None:
"""
Method to get TIMDEX "links" field. This method broken out to allow subclasses
to override.
Expand Down
2 changes: 1 addition & 1 deletion transmogrifier/sources/xml/springshare.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def get_links(self, source_record_id: str, xml: Tag) -> list[timdex.Link] | None

@classmethod
def get_source_link(
cls, source_base_url: str, source_record_id: str, xml: Tag # noqa: ARG003
cls, _source_base_url: str, _source_record_id: str, xml: Tag
) -> str:
"""
Override for default source_link behavior.
Expand Down

0 comments on commit 106d5f7

Please sign in to comment.