Skip to content

Commit 2fa1b2d

Browse files
committed
fix: 更新 pylint 配置以排除测试文件,修复配置类中的变量名
1 parent 421a5f0 commit 2fa1b2d

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

.github/workflows/pylint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ jobs:
2424
pip install -r ./requirements.txt
2525
- name: Analysing the code with pylint
2626
run: |
27-
pylint $(git ls-files '*.py')
27+
pylint $(git ls-files '*.py' | grep -v "tests/")

app/models/config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def from_yaml(cls, yaml_file: str = "config.yaml"):
6565
config_path = pathlib.Path.cwd() / yaml_file
6666

6767
# 使用默认值初始化
68-
settings = cls()
68+
config = cls()
6969

7070
# 如果配置文件存在,则加载
7171
if config_path.exists(): # pylint: disable=too-many-nested-blocks
@@ -91,8 +91,8 @@ def from_yaml(cls, yaml_file: str = "config.yaml"):
9191

9292
# 更新基本配置
9393
for key, value in config_data.items():
94-
if key != "WEBHOOK" and hasattr(settings, key):
95-
setattr(settings, key, value)
94+
if key != "WEBHOOK" and hasattr(config, key):
95+
setattr(config, key, value)
9696
else:
9797
print(f"警告:配置文件 {yaml_file} 不存在,使用默认配置")
9898

@@ -127,4 +127,4 @@ def from_yaml(cls, yaml_file: str = "config.yaml"):
127127

128128
print(f"已创建默认配置文件:{config_path}")
129129

130-
return settings
130+
return config

config/templates/push/default.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@
55
提交数量:{{ commit_count }}
66
{% for commit in commits[:3] %}
77
[{{ loop.index }}] {{ commit.id[:7] }} by {{ commit.author.name }}
8-
{{ commit.message.split('
9-
')[0] }}
8+
{{ commit.message.split('')[0] }}
109
{% endfor %}

0 commit comments

Comments
 (0)