Skip to content

Commit c849ac8

Browse files
committed
Lint
1 parent 2976a61 commit c849ac8

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

geojson_pydantic/features.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,20 @@ class Config:
2929

3030
@validator("bbox", pre=True)
3131
def check_bbox(cls, bbox: BBox) -> BBox:
32+
"""Check that bbox is valid."""
3233
if len(bbox) == 6:
33-
if bbox[0] > bbox[3] or bbox[1] > bbox[4] or bbox[2] > bbox[5]:
34-
raise ValueError("BBox must be in the form [west, south, bottom, east, north, top]")
34+
if bbox[0] > bbox[3] or bbox[1] > bbox[4] or bbox[2] > bbox[5]: # type: ignore
35+
raise ValueError(
36+
"BBox must be in the form [west, south, bottom, east, north, top]"
37+
)
3538
elif len(bbox) == 4:
3639
if bbox[0] > bbox[2] or bbox[1] > bbox[3]:
3740
raise ValueError("BBox must be in the form [west, south, east, north]")
3841
else:
39-
raise ValueError("BBox must be in the form [west, south, east, north] or [west, south, bottom, east, north, top]")
40-
return bbox
41-
42+
raise ValueError(
43+
"BBox must be in the form [west, south, east, north] or [west, south, bottom, east, north, top]"
44+
)
45+
return bbox
4246

4347
@validator("geometry", pre=True, always=True)
4448
def set_geometry(cls, geometry: Any) -> Any:

tests/test_features.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,4 +236,4 @@ def test_feature_validation():
236236

237237
with pytest.raises(ValidationError):
238238
# bad bbox3d
239-
Feature(type="Feature", properties=None, bbox=[100, 100, 100, 0, 0, 0])
239+
Feature(type="Feature", properties=None, bbox=[100, 100, 100, 0, 0, 0])

0 commit comments

Comments
 (0)