diff --git a/pyproject.toml b/pyproject.toml index fdebc38..5c3e575 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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. diff --git a/utils/dd_to_csv.py b/utils/dd_to_csv.py index 40d9372..7d26227 100644 --- a/utils/dd_to_csv.py +++ b/utils/dd_to_csv.py @@ -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) diff --git a/xl2times/utils.py b/xl2times/utils.py index 57bddae..9f2a825 100644 --- a/xl2times/utils.py +++ b/xl2times/utils.py @@ -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("*", ".*"))