fix: reduce low-risk pylint issues

This commit is contained in:
jxxghp
2026-05-17 08:01:39 +08:00
parent 0ee9fec1d2
commit 3ee601574c
11 changed files with 28 additions and 18 deletions

View File

@@ -998,7 +998,8 @@ def config_list(show_secrets: bool) -> None:
@click.argument("key")
def config_get(key: str) -> None:
"""读取单个配置项"""
if key not in Settings.model_fields and not hasattr(settings, key):
setting_fields = Settings.model_fields.keys()
if key not in setting_fields and not hasattr(settings, key):
raise click.ClickException(f"配置项不存在:{key}")
click.echo(_format_value(getattr(settings, key)))