From ecb1fcf940ae937c94989da6a91c4d36c874838c Mon Sep 17 00:00:00 2001 From: wu Date: Sun, 23 Apr 2023 23:12:06 +0800 Subject: [PATCH] update the ruff settings --- .gitignore | 1 + .ruff.toml | 22 ++++++++++++++++++++++ backend/app/database/base_class.py | 4 ++-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2fad5b5d..d5c886cc 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ venv/ backend/app/log/ backend/app/alembic/versions/ backend/app/static/media/ +.ruff_cache/ diff --git a/.ruff.toml b/.ruff.toml index 56a194c5..385246f6 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -1,2 +1,24 @@ ignore = ["F401"] line-length = 120 +format = "grouped" +target-version = "py38" +cache-dir = "./.ruff_cache" + +[flake8-pytest-style] +mark-parentheses = false +parametrize-names-type = "list" +parametrize-values-row-type = "list" +parametrize-values-type = "tuple" + +[flake8-quotes] +avoid-escape = false +docstring-quotes = "double" +inline-quotes = "single" +multiline-quotes = "double" + +[flake8-unused-arguments] +ignore-variadic-names = true + +[isort] +lines-between-types = 1 +order-by-type = true diff --git a/backend/app/database/base_class.py b/backend/app/database/base_class.py index 5a8725e6..a7ec1099 100644 --- a/backend/app/database/base_class.py +++ b/backend/app/database/base_class.py @@ -48,7 +48,7 @@ class DataClassBase(MappedAsDataclass, MappedBase): 声明性数据类基类, 它将带有数据类集成, 允许使用更高级配置, 但你必须注意它的一些特性, 尤其是和 DeclarativeBase 一起使用时 `MappedAsDataclass `__ - """ + """ # noqa: E501 __abstract__ = True @@ -56,7 +56,7 @@ class DataClassBase(MappedAsDataclass, MappedBase): class Base(DataClassBase, _BaseMixin): """ 声明性 Mixin 数据类基类, 带有数据类集成, 并包含 MiXin 数据类基础表结构, 你可以简单的理解它为含有基础表结构的数据类基类 - """ + """ # noqa: E501 __abstract__ = True