Skip to content

Commit

Permalink
Update ruff version used by pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Argmaster committed Jan 29, 2025
1 parent ac7561f commit 7feb5f0
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ repos:
- id: debug-statements

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.7.3"
rev: "v0.8.1"
hooks:
# Run the linter.
- id: ruff
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@ prepare-deploy-package = [
lint.select = ["ALL"]
lint.ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in {name}
"ANN101", # Missing type annotation for {name} in method
"ANN102", # Missing type annotation for {name} in classmethod
"D203", # 1 blank line required before class docstring
"D205", # 1 blank line required between summary line and description
"D213", # Multi-line docstring summary should start at the second line
Expand All @@ -227,6 +225,7 @@ lint.ignore = [
"S101", # Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
"EXE002", # Breaks on file systems which do not support executable permissions.
"EM101", # Stupid errors when exceptions are parametrized by short strings.
"A004", # Import `X` is shadowing a Python builtin
]
show-fixes = true
target-version = "py38"
Expand Down
10 changes: 5 additions & 5 deletions src/pygerber/gerber/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@
from pygerber.vm.types import Color, Style

__all__ = [
"DEFAULT_ALPHA_COLOR_MAP",
"DEFAULT_COLOR_MAP",
"Color",
"CompositeImage",
"CompositePillowImage",
"CompositeView",
"DEFAULT_ALPHA_COLOR_MAP",
"DEFAULT_COLOR_MAP",
"DesignRules",
"FilesAttributes",
"FileTypeEnum",
"FilesAttributes",
"GeneralSpecs",
"GenerationSoftware",
"GerberFile",
Expand All @@ -54,13 +55,12 @@
"Image",
"ImageSpace",
"MaterialStackup",
"Options",
"PathToGerberJobProjectNotDefinedError",
"PillowImage",
"ProjectId",
"ShapelyImage",
"Size",
"Style",
"Color",
"Units",
"Options",
]
32 changes: 16 additions & 16 deletions src/pygerber/gerber/ast/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,28 @@
)

__all__ = [
"AstVisitor",
"AstError",
"VisitorError",
"StateTrackingVisitor",
"DirectADHandlerDispatchNotSupportedError",
"ApertureNotSelectedError",
"ApertureNotFoundError",
"SourceNotAvailableError",
"ApertureNotSelectedError",
"ApertureStorage",
"ArcInterpolation",
"AstError",
"AstVisitor",
"Attributes",
"CoordinateFormat",
"CoordinateFormatNotSetError",
"PackedCoordinateTooLongError",
"PackedCoordinateTooShortError",
"DirectADHandlerDispatchNotSupportedError",
"ExpressionEvalVisitor",
"NodeFinder",
"State",
"CoordinateFormat",
"Attributes",
"ImageAttributes",
"Transform",
"NodeFinder",
"PackedCoordinateTooLongError",
"PackedCoordinateTooShortError",
"PlotMode",
"ArcInterpolation",
"ApertureStorage",
"ProgramStop",
"SourceNotAvailableError",
"State",
"StateTrackingVisitor",
"Transform",
"VisitorError",
]


Expand Down
2 changes: 1 addition & 1 deletion src/pygerber/gerber/ast/nodes/attribute/TF.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

import datetime # noqa: TCH003
import datetime # noqa: TC003
import hashlib
from typing import TYPE_CHECKING, Callable, List, Literal, Optional

Expand Down
18 changes: 9 additions & 9 deletions src/pygerber/gerber/formatter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@
from pygerber.gerber.ast.nodes import File

__all__ = [
"Formatter",
"extra_indent",
"balanced",
"small_indent",
"MacroSplitMode",
"MacroEndInNewLine",
"FloatTrimTrailingZeros",
"EmptyLineBeforePolaritySwitch",
"ExplicitParenthesis",
"FloatTrimTrailingZeros",
"Formatter",
"KeepNonStandaloneCodes",
"MacroEndInNewLine",
"MacroSplitMode",
"Options",
"RemoveG54",
"RemoveG55",
"ExplicitParenthesis",
"StripWhitespace",
"Options",
"balanced",
"extra_indent",
"small_indent",
]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

if is_language_server_available():
import lsprotocol.types as lspt
from pygls.server import LanguageServer # noqa: TCH002
from pygls.server import LanguageServer # noqa: TC002


class Document:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

if is_language_server_available():
import lsprotocol.types as lspt
from pygls.server import LanguageServer # noqa: TCH002
from pygls.server import LanguageServer # noqa: TC002


def sha256(s: str) -> str:
Expand Down
8 changes: 4 additions & 4 deletions src/pygerber/vm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

__all__ = [
"RVMC",
"VirtualMachine",
"CommandVisitor",
"Result",
"Layer",
"EagerLayer",
"DeferredLayer",
"EagerLayer",
"Layer",
"Result",
"VirtualMachine",
]


Expand Down
8 changes: 4 additions & 4 deletions src/pygerber/vm/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
from pygerber.vm.commands.shape_segments import Arc, Line, ShapeSegment

__all__ = [
"ShapeSegment",
"Arc",
"Command",
"EndLayer",
"Line",
"PasteLayer",
"Shape",
"ShapeSegment",
"StartLayer",
"EndLayer",
"PasteLayer",
"Command",
]
2 changes: 1 addition & 1 deletion src/pygerber/vm/commands/shape_segments/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
from pygerber.vm.commands.shape_segments.line import Line
from pygerber.vm.commands.shape_segments.shape_segment import ShapeSegment

__all__ = ["ShapeSegment", "Line", "Arc"]
__all__ = ["Arc", "Line", "ShapeSegment"]
6 changes: 3 additions & 3 deletions src/pygerber/vm/pillow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
)

__all__ = [
"PillowVirtualMachineError",
"DPMMTooSmallError",
"PillowVirtualMachine",
"PillowResult",
"PillowDeferredLayer",
"PillowEagerLayer",
"PillowResult",
"PillowVirtualMachine",
"PillowVirtualMachineError",
]
6 changes: 3 additions & 3 deletions src/pygerber/vm/shapely/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
)

__all__ = [
"ShapelyVirtualMachine",
"ShapelyEagerLayer",
"ShapelyDeferredLayer",
"ShapelyResult",
"ShapelyEagerLayer",
"ShapelyNotInstalledError",
"ShapelyResult",
"ShapelyVirtualMachine",
"ShapelyVirtualMachineError",
]
14 changes: 7 additions & 7 deletions src/pygerber/vm/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
from pygerber.vm.types.vector import Vector

__all__ = [
"Vector",
"Matrix3x3",
"Box",
"LayerID",
"Color",
"VirtualMachineError",
"EmptyAutoSizedLayerNotAllowedError",
"NoLayerSetError",
"LayerNotFoundError",
"LayerAlreadyExistsError",
"PasteDeferredLayerNotAllowedError",
"LayerID",
"LayerNotFoundError",
"Matrix3x3",
"NoLayerSetError",
"NoMainLayerError",
"PasteDeferredLayerNotAllowedError",
"Style",
"Vector",
"VirtualMachineError",
]

0 comments on commit 7feb5f0

Please sign in to comment.