mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-01-26 10:33:12 -05:00
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:
@@ -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"] = []
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
# ====================
|
||||
|
||||
Reference in New Issue
Block a user