Skip to content

Commit

Permalink
ruff uses python>=3.11
Browse files Browse the repository at this point in the history
fixed loop lint errors
  • Loading branch information
SamRWest committed Mar 13, 2024
1 parent 04c16ae commit f40e4a7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ test = { cmd = "pytest --cov-report term --cov-report html --cov=xl2times --cov=
# Config for various pre-commit checks are below
# Ruff linting rules - see https://github.com/charliermarsh/ruff and https://beta.ruff.rs/docs/rules/
[tool.ruff]
target-version = "py39"
target-version = "py311"
line-length = 88

# Option 1: use basic rules only.
Expand Down
9 changes: 4 additions & 5 deletions utils/dd_to_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,10 @@ def convert_dd_to_tabular(
# The following will overwrite data obtained from headers_by_attr
# TODO: Remove once migration is done?
for line in lines:
# TODO Fix: PLW2901 `for` loop variable `line` overwritten by assignment target
line = line.strip() # noqa
if line != "":
param_name = line.split("[")[0]
attributes = line.split("[")[1].split("]")[0].split(",")
ln = line.strip()
if ln != "":
param_name = ln.split("[")[0]
attributes = ln.split("[")[1].split("]")[0].split(",")
headers_data[param_name] = [*attributes]

save_data_with_headers(all_parameters, headers_data, param_path)
Expand Down
5 changes: 2 additions & 3 deletions xl2times/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,8 @@ def apply_wildcards(
current_list = []
for wildcard in wildcard_list:
if wildcard.startswith("-"):
# TODO Fix: PLW2901 `for` loop variable `line` overwritten by assignment target
wildcard = wildcard[1:] # noqa
regexp = re.compile(wildcard.replace("*", ".*"))
w = wildcard[1:]
regexp = re.compile(w.replace("*", ".*"))
current_list = [s for s in current_list if not regexp.match(s)]
else:
regexp = re.compile(wildcard.replace("*", ".*"))
Expand Down

0 comments on commit f40e4a7

Please sign in to comment.