Skip to content

Commit

Permalink
More linting
Browse files Browse the repository at this point in the history
  • Loading branch information
masaccio committed Oct 14, 2024
1 parent c2fad65 commit b7bc5a7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ ignore = [
"PLR0913", #Too many arguments
"PLR2004", #Magic value used
"PLW0603", #Using the global statement
"PTH103", # Use of os.makedirs()
"PTH118", # Use of os.path.join()
"PTH119", # Use of os.path.basename()
"PTH123", # Use of open()
"RUF001", #String contains ambiguous
"RUF002", #Docstring contains ambiguous
"RUF003", #Comment contains ambiguous
Expand Down
4 changes: 2 additions & 2 deletions src/numbers_parser/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ def merge_ranges(self) -> list[str]:
merge_cells.add(xl_range(row, col, row + size[0] - 1, col + size[1] - 1))
return sorted(merge_cells)

def cell(self, *args) -> Cell | MergedCell:
def cell(self, *args) -> Cell | MergedCell: # noqa: D417
"""Return a single cell in the table.
The ``cell()`` method supports two forms of notation to designate the position
Expand Down Expand Up @@ -895,7 +895,7 @@ def _validate_cell_coords(self, *args):

return (row, col, *tuple(values))

def write(self, *args, style: Style | str | None = None) -> None:
def write(self, *args, style: Style | str | None = None) -> None: # noqa: D417
"""Write a value to a cell and update the style/cell type.
The ``write()`` method supports two forms of notation to designate the position
Expand Down
10 changes: 6 additions & 4 deletions src/numbers_parser/iwafile.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,10 @@ def to_buffer(self):
provided_length = message_info.length
if object_length != provided_length:
message_info.length = object_length
except EncodeError as e: # pragma: no cover
msg = f"Failed to encode object: {e}\nObject: '{obj!r}'\nMessage info: {message_info}"
except EncodeError as e: # pragma: no cover # noqa: PERF203
msg = (
f"Failed to encode object: {e}\nObject: '{obj!r}'\nMessage info: {message_info}"
)
raise ValueError(
msg,
) from None
Expand Down Expand Up @@ -263,12 +265,12 @@ def get_archive_info_and_remainder(buf):
return ArchiveInfo.FromString(msg_buf), buf[n:]


def create_iwa_segment(id: int, cls: object, object_dict: dict) -> object:
def create_iwa_segment(obj_id: int, cls: object, object_dict: dict) -> object:
full_name = cls.DESCRIPTOR.full_name
type_id = NAME_ID_MAP[full_name]
header = {
"_pbtype": "TSP.ArchiveInfo",
"identifier": str(id),
"identifier": str(obj_id),
"message_infos": [
{
"type": type_id,
Expand Down

0 comments on commit b7bc5a7

Please sign in to comment.