Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-merge-conflict
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
rev: v0.14.13
hooks:
- id: ruff
args: [--fix, --show-fixes, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.0
rev: v1.19.1
hooks:
- id: mypy
2 changes: 1 addition & 1 deletion src/gflabel/bases/modern.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _convert_u_to_mm(u: pint.Quantity):

if LABEL_DEPTH >= H_mm / 2 or LABEL_DEPTH >= W_mm / 2:
raise ValueError(
f"Error: Cannot have label depth ({LABEL_DEPTH:.1f} mm) being greater than half the width ({W_mm/2:.1f} mm) or height ({H_mm/2:.1f} mm)"
f"Error: Cannot have label depth ({LABEL_DEPTH:.1f} mm) being greater than half the width ({W_mm / 2:.1f} mm) or height ({H_mm / 2:.1f} mm)"
)

# Label constructed by angled extrusion of inner sketch
Expand Down
6 changes: 3 additions & 3 deletions src/gflabel/fragments.py
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ def _match_electronic_symbol_with_selectors(selectors: Iterable[str]) -> Manifes
matches = _match_electronic_symbol_from_standard(standards_order, matches)
if len(matches) == 1:
logger.debug(
f"Using symbol \"{matches[0]['id']}\" because standard [b]{matches[0]['standard']}[/b] is preferred.",
f'Using symbol "{matches[0]["id"]}" because standard [b]{matches[0]["standard"]}[/b] is preferred.',
extra={"markup": True},
)
return matches[0]
Expand All @@ -1146,7 +1146,7 @@ def _match_electronic_symbol_with_selectors(selectors: Iterable[str]) -> Manifes
if matches:
cols = ["ID", "Category", "Name", "Standard", "Filename"]
logger.error(
f"Could not decide on symbol from fuzzy specification \"{','.join(requested)}\". Possible options:"
f'Could not decide on symbol from fuzzy specification "{",".join(requested)}". Possible options:'
+ "\n"
+ "\n".join(
format_table(cols, matches, lambda x: x.lower(), prefix=" ")
Expand All @@ -1155,7 +1155,7 @@ def _match_electronic_symbol_with_selectors(selectors: Iterable[str]) -> Manifes
)
else:
logger.error(
f"No electronic symbols matched the specification \"{','.join(requested)}\""
f'No electronic symbols matched the specification "{",".join(requested)}"'
)
raise InvalidFragmentSpecification("Please specify symbol more precisely.")

Expand Down
2 changes: 1 addition & 1 deletion src/gflabel/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def _do_multiline_render(
- (row_height + self.opts.line_spacing_mm) * n
- row_height / 2
)
logger.info(f'Rendering line {n+1} ("{line}")')
logger.info(f'Rendering line {n + 1} ("{line}")')
IndentingRichHandler.indent()
with Locations([(0, render_y)]):
add(
Expand Down
6 changes: 3 additions & 3 deletions src/gflabel/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ def from_args(cls, args: argparse.Namespace) -> RenderOptions:
"Got non-length dimension pint quantity for args.margin"
)
margin_mm = args.margin.to("mm").magnitude
assert (
margin_mm is not None
), "Margin should have been set either by user or defaults"
assert margin_mm is not None, (
"Margin should have been set either by user or defaults"
)
return cls(
margin_mm=margin_mm,
font=FontOptions(
Expand Down