Skip to content

Commit

Permalink
Update pre-commit (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro authored Aug 10, 2023
1 parent c07aabc commit 253687d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
- id: trailing-whitespace
exclude: \.svg$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.276
rev: v0.0.283
hooks:
- id: ruff
args: [geoviews]
Expand Down
2 changes: 1 addition & 1 deletion geoviews/data/geom_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def select(cls, dataset, selection_mask=None, **selection):
new_data[k] = v
else:
new_data[k] = v[selection_mask]
if indexed and len(list(new_data.values())[0]) == 1 and len(dataset.vdims) == 1:
if indexed and len(next(iter(new_data.values()))) == 1 and len(dataset.vdims) == 1:
value = new_data[dataset.vdims[0].name]
return value if isscalar(value) else value[0]
return new_data
Expand Down
4 changes: 2 additions & 2 deletions geoviews/element/geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -996,8 +996,8 @@ def from_records(cls, records, dataset=None, on=None, value=None,
vdims = dataset.vdims
ddims = dataset.dimensions()
if None in vdims:
raise ValueError('Value dimension {} not found '
'in dataset dimensions {}'.format(value, ddims) )
raise ValueError(f'Value dimension {value} not found '
f'in dataset dimensions {ddims}' )
else:
vdims = []

Expand Down
13 changes: 10 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ target-version = "py38"
select = [
"E",
"F",
"FLY",
"ICN",
"NPY",
"PIE",
"PLC",
"PLE",
"PLR",
Expand All @@ -32,11 +35,12 @@ ignore = [
"E731", # Do not assign a lambda expression, use a def
"E741", # Ambiguous variable name
"F405", # From star imports
"PLC1901", # empty string is falsey
"PLE0604", # Invalid object in `__all__`, must contain only strings
"PLE0605", # Invalid format for __all__
"PLE0605", # Invalid format for `__all__`
"PLR091", # Too many arguments/branches/statements
"PLR2004", # Magic value used in comparison
"PLW2901", # For loop variable overwritten
"PLW2901", # `for` loop variable is overwritten
"RUF005", # Consider {expr} instead of concatenation
"RUF012", # Mutable class attributes should use `typing.ClassVar`
]
Expand All @@ -48,7 +52,10 @@ unfixable = [

[tool.ruff.per-file-ignores]
"__init__.py" = ["F403"]
"geoviews/tests/*" = ["RUF001", "RUF002", "RUF003"] # Ambiguous unicode character
"geoviews/tests/*" = [
"RUF001", "RUF002", "RUF003", # Ambiguous unicode character
"NPY002", # Replace legacy `np.random.rand` call with Generator
]

[tool.codespell]
ignore-words-list = "lod,nd"
Expand Down

0 comments on commit 253687d

Please sign in to comment.