chore(deps): update dependency ruff to ^0.1.0 (#2944)

* chore(deps): update dependency ruff to ^0.1.0

* fix breaking cfg change

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
This commit is contained in:
renovate[bot]
2024-01-11 00:53:54 +00:00
committed by GitHub
parent 1d7fc0a945
commit ce929f2833
7 changed files with 28 additions and 29 deletions

View File

@@ -39,7 +39,7 @@ class MealieAlphaMigrator(BaseMigrator):
with contextlib.suppress(KeyError):
if "" in recipe["categories"]:
recipe["categories"] = [cat for cat in recipe["categories"] if cat != ""]
if type(recipe["extras"]) == list:
if isinstance(recipe["extras"], list):
recipe["extras"] = {}
recipe["comments"] = []

View File

@@ -23,8 +23,7 @@ def plantoeat_recipes(file: Path):
for name in Path(tmpdir).glob("**/[!.]*.csv"):
with open(name, newline="") as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
yield row
yield from reader
def get_value_as_string_or_none(dictionary: dict, key: str):

View File

@@ -187,7 +187,7 @@ def import_data(lines):
token = unclump(token)
# turn B-NAME/123 back into "name"
tag, confidence = re.split(r"/", columns[-1], 1)
tag, confidence = re.split(r"/", columns[-1], maxsplit=1)
tag = re.sub(r"^[BI]\-", "", tag).lower() # noqa: W605 - invalid dscape sequence
# ====================