Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pr check workflow #8

Merged
merged 4 commits into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: PR checks

on:
pull_request:
workflow_dispatch:

jobs:
check-pr:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- run: pip install -r requirements.txt
- run: ruff .
2 changes: 1 addition & 1 deletion .github/workflows/deploy-image.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Image CI
name: Build Docker image

on:
workflow_dispatch:
Expand Down
5 changes: 5 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ target-version = "py310"

line-length = 88
indent-width = 4

lint.external = ['F403']
extend-exclude = [
"./tests"
]
1 change: 1 addition & 0 deletions app/exceptions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ruff: noqa: F403
"""
所有API异常定义在此
"""
Expand Down
14 changes: 7 additions & 7 deletions app/models/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,14 +780,14 @@ def init_system_languages(cls) -> None:
logger.info("已存在语言表,跳过初始化")
return
sort = 0
for l in cls.SYSTEM_LANGUAGES_DATA:
for lang in cls.SYSTEM_LANGUAGES_DATA:
cls(
en_name=l["en_name"],
lo_name=l["lo_name"],
no_space=l.get("no_space", False),
code=l["code"],
g_tra_code=l["g_tra_code"],
g_ocr_code=l["g_ocr_code"],
en_name=lang["en_name"],
lo_name=lang["lo_name"],
no_space=lang.get("no_space", False),
code=lang["code"],
g_tra_code=lang["g_tra_code"],
g_ocr_code=lang["g_ocr_code"],
sort=sort,
).save()
sort += 1
Expand Down
1 change: 1 addition & 0 deletions app/tasks/output_project.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ruff: noqa: F841
"""
导出项目
"""
Expand Down