Skip to content

Commit

Permalink
chore(deps): update dependency ruff to ^0.1.0 (#2944)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
renovate[bot] and michael-genson authored Jan 11, 2024
1 parent 1d7fc0a commit ce929f2
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 29 deletions.
4 changes: 2 additions & 2 deletions mealie/repos/repository_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def get_all_public(self, limit: int | None = None, order_by: str | None = None,
stmt = (
select(self.model)
.join(RecipeSettings)
.filter(RecipeSettings.public == True) # noqa: 711
.filter(RecipeSettings.public == True) # noqa: E712
.order_by(order_attr.desc())
.offset(start)
.limit(limit)
Expand All @@ -63,7 +63,7 @@ def get_all_public(self, limit: int | None = None, order_by: str | None = None,
stmt = (
select(self.model)
.join(RecipeSettings)
.filter(RecipeSettings.public == True) # noqa: 711
.filter(RecipeSettings.public == True) # noqa: E712
.offset(start)
.limit(limit)
)
Expand Down
2 changes: 1 addition & 1 deletion mealie/routes/_base/routers.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async def custom_route_handler(request: Request) -> Response:
with contextlib.suppress(JSONDecodeError):
response = await original_route_handler(request)
response_body = json.loads(response.body)
if type(response_body) == dict:
if isinstance(response_body, dict):
if last_modified := response_body.get("updateAt"):
response.headers["last-modified"] = last_modified

Expand Down
2 changes: 1 addition & 1 deletion mealie/services/migrations/mealie_alpha.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _convert_to_new_schema(self, recipe: dict) -> Recipe:
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"] = []
Expand Down
3 changes: 1 addition & 2 deletions mealie/services/migrations/plantoeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion mealie/services/parser_services/crfpp/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

# ====================
Expand Down
40 changes: 20 additions & 20 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pylint = "^3.0.0"
pytest = "^7.2.0"
pytest-asyncio = "^0.23.0"
rich = "^13.5.2"
ruff = "^0.0.265"
ruff = "^0.1.0"
types-PyYAML = "^6.0.4"
types-python-dateutil = "^2.8.18"
types-python-slugify = "^6.0.0"
Expand Down Expand Up @@ -107,7 +107,7 @@ strict_optional = true

[tool.ruff]
line-length = 120
format = "text"
output-format = "text"

# Enable Pyflakes `E` and `F` codes by default.
ignore = ["F403", "TID252", "B008"]
Expand Down

0 comments on commit ce929f2

Please sign in to comment.