Skip to content

Commit

Permalink
Add pr check workflow (#8)
Browse files Browse the repository at this point in the history
* rename build image workflow
* add check-pr workflow
* make linter happy
  • Loading branch information
jokester authored Mar 3, 2024
1 parent 0c683dc commit 0772397
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 8 deletions.
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

0 comments on commit 0772397

Please sign in to comment.