diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6b74261..9d86089 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/src/gflabel/bases/modern.py b/src/gflabel/bases/modern.py index f4dab9b..5d189c9 100644 --- a/src/gflabel/bases/modern.py +++ b/src/gflabel/bases/modern.py @@ -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 diff --git a/src/gflabel/fragments.py b/src/gflabel/fragments.py index c821679..7bf86b1 100644 --- a/src/gflabel/fragments.py +++ b/src/gflabel/fragments.py @@ -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] @@ -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=" ") @@ -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.") diff --git a/src/gflabel/label.py b/src/gflabel/label.py index 5735301..6b1c2ea 100644 --- a/src/gflabel/label.py +++ b/src/gflabel/label.py @@ -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( diff --git a/src/gflabel/options.py b/src/gflabel/options.py index 110899d..bdc1832 100644 --- a/src/gflabel/options.py +++ b/src/gflabel/options.py @@ -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(