Skip to content

Commit

Permalink
run safe fixes, set ignored ruff violations
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Jul 5, 2024
1 parent ef1ead4 commit 585e6e1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
14 changes: 13 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,19 @@ ignore = [
"COM", # commas
"D205", # blank-line-after-summary
"D400", # ends-in-period
"D401" # non-imperative-mood
"D401", # non-imperative-mood
# The following ignore codes are disabled because the codebase is not yet compliant
"BLE001", # Do not catch blind exception: `Exception`
"PERF203", # `try`-`except` within a loop incurs performance overhead
"PTH100", # `os.path.abspath()` should be replaced by `Path.resolve()`
"PTH107", # `os.remove()` should be replaced by `Path.unlink()`
"PTH110", # ``os.path.exists()` should be replaced by `Path.exists()`
"PTH120", # `os.path.dirname()` should be replaced by `Path.parent`
"PTH123", # `open()` should be replaced by `Path.open()`
"RUF013", # PEP 484 prohibits implicit `Optional`
"S110", # `try`-`except`-`pass` detected, consider logging the exception
"UP006", # Use `list` instead of `List` for type annotation
"UP007" # Use `X | Y` for type annotations
]
select = [
"BLE", # blind-except
Expand Down
2 changes: 1 addition & 1 deletion src/xncml/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import xmltodict


class Dataset(object):
class Dataset:
"""A class for reading and manipulating NcML file.
Note that NcML documents are used for two distinct purposes:
Expand Down
10 changes: 5 additions & 5 deletions src/xncml/generated/ncml_2_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ class Meta:
"type": "Element",
},
)
variable: List["Variable"] = field(
variable: List[Variable] = field(
default_factory=list,
metadata={
"type": "Element",
Expand Down Expand Up @@ -535,7 +535,7 @@ class Meta:
),
},
)
variable_agg: List["Aggregation.VariableAgg"] = field(
variable_agg: List[Aggregation.VariableAgg] = field(
default_factory=list,
metadata={
"name": "variableAgg",
Expand All @@ -556,19 +556,19 @@ class Meta:
"type": "Element",
},
)
netcdf: List["Netcdf"] = field(
netcdf: List[Netcdf] = field(
default_factory=list,
metadata={
"type": "Element",
},
)
scan: List["Aggregation.Scan"] = field(
scan: List[Aggregation.Scan] = field(
default_factory=list,
metadata={
"type": "Element",
},
)
scan_fmrc: List["Aggregation.ScanFmrc"] = field(
scan_fmrc: List[Aggregation.ScanFmrc] = field(
default_factory=list,
metadata={
"name": "scanFmrc",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
data = Path(__file__).parent / "data"


class CheckClose(object):
class CheckClose:
"""Check that files are closed after the test. Note that `close` has to be explicitly called within the
context manager for this to work.
"""
Expand Down

0 comments on commit 585e6e1

Please sign in to comment.