Skip to content

Commit

Permalink
Merge pull request #2347 from gdsfactory/use_ruff_instead_of_black
Browse files Browse the repository at this point in the history
use ruff instead of black
  • Loading branch information
joamatab committed Dec 2, 2023
2 parents 76167ed + 4db02bb commit f3edf0c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 32 deletions.
6 changes: 1 addition & 5 deletions .pre-commit-config.yaml
Expand Up @@ -7,11 +7,6 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black
# exclude: '^gdsfactory/samples/notebooks/|^docs/notebooks/'

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
Expand All @@ -25,6 +20,7 @@ repos:
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
- id: ruff-format

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.11.0
Expand Down
5 changes: 3 additions & 2 deletions gdsfactory/components/disk.py
Expand Up @@ -10,8 +10,9 @@
def _compute_parameters(xs_bend, wrap_angle_deg, radius):
r_bend = xs_bend.radius
theta = wrap_angle_deg / 2.0
size_x, dy = r_bend * np.sin(theta * np.pi / 180), r_bend - r_bend * np.cos(
theta * np.pi / 180
size_x, dy = (
r_bend * np.sin(theta * np.pi / 180),
r_bend - r_bend * np.cos(theta * np.pi / 180),
)
bus_length = max(4 * size_x, 2 * radius)
return (r_bend, size_x, dy, bus_length)
Expand Down
2 changes: 1 addition & 1 deletion gdsfactory/routing/route_fiber_array.py
Expand Up @@ -600,7 +600,7 @@ def demo() -> None:
# with_loopback=False,
layer_label="TEXT",
layer_label_loopback="TEXT",
radius=5
radius=5,
# get_input_labels_function=get_input_labels_dash
# get_input_labels_function=None
# optical_routing_type=2,
Expand Down
25 changes: 3 additions & 22 deletions pyproject.toml
Expand Up @@ -83,37 +83,18 @@ full = [
"gplugins[devsim,femwell,gmsh,meow,meshwell,ray,sax,schematic,tidy3d]"
]
maintainer = [
"black>=21",
"ruff",
"doc8",
"xdoctest",
"mypy",
"tbump",
"autotyping"
"autotyping",
"towncrier"
]

[project.scripts]
gf = "gdsfactory.cli:app"

[tool.black]
exclude = ''' # Specify the files/dirs that should be ignored by the black formatter
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| env
| _build
| buck-out
| build
| dist
)/
'''
include = '\.pyi?$'
line-length = 88
target-version = ['py310']

[tool.codespell]
ignore-words-list = "te, te/tm, te, ba, fpr, fpr_spacing, ro, nd, donot, schem"

Expand Down
2 changes: 1 addition & 1 deletion tests/routing/test_routing_get_bundle.py
Expand Up @@ -456,7 +456,7 @@ def test_get_bundle_small() -> None:
[c1.ports["o3"], c1.ports["o4"]],
[c2.ports["o2"], c2.ports["o1"]],
separation=5.0,
cross_section=gf.cross_section.strip(radius=5, layer=(2, 0))
cross_section=gf.cross_section.strip(radius=5, layer=(2, 0)),
# cross_section=gf.cross_section.strip,
)
for route in routes:
Expand Down
2 changes: 1 addition & 1 deletion tests/routing/test_routing_manhattan.py
Expand Up @@ -50,7 +50,7 @@ def test_manhattan() -> None:
radius=5.0,
auto_widen=True,
width_wide=2,
layer=layer
layer=layer,
# width=0.2,
)

Expand Down

0 comments on commit f3edf0c

Please sign in to comment.