Skip to content

Add ruff + black to CI as a lint/format check - #56

Open
qiaobochi040726-source wants to merge 3 commits into
BreachDirect:mainfrom
qiaobochi040726-source:20260806-ruff-black-ci
Open

Add ruff + black to CI as a lint/format check#56
qiaobochi040726-source wants to merge 3 commits into
BreachDirect:mainfrom
qiaobochi040726-source:20260806-ruff-black-ci

Conversation

@qiaobochi040726-source

Copy link
Copy Markdown
Contributor

Fixes #32

  • pyproject.toml:新增 [tool.ruff] / [tool.black](line-length 100, target py310);dev 依赖加 black>=24.0、ruff>=0.6(不进运行时依赖)
  • 新增 .github/workflows/lint.yml:push + pull_request 触发,Python 3.10/3.11 matrix,ruff check + black --check
  • 代码修复(全部零行为变化):导入排序、Optional[str]→str|None、subprocess.run 显式 check=False(PLW1510)、盲 except 加 # noqa: BLE001 并保留原注释、SIM117/RUF015、black 格式化

验证:ruff check All checks passed;black --check 14 files unchanged;pytest 15 passed。

qiaobochi040726-source and others added 2 commits August 6, 2026 04:50
- Add [tool.ruff] and [tool.black] config (line-length 100, py310) and
  dev optional-dependencies for ruff/black.
- Add .github/workflows/lint.yml running ruff check and black --check on
  push and pull_request across Python 3.10/3.11.
- Fix all ruff findings: explicit check=False on subprocess.run, drop
  redundant quotes/Optional in annotations, sort imports, combine nested
  withs, use next() instead of [0]; noqa BLE001 for the intentional
  catch-all in the aggregator.
- Format all source and test files with black.
@ToryMic

ToryMic commented Aug 7, 2026

Copy link
Copy Markdown
Member

CI failing, recheck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ruff + black to CI as a lint/format check

2 participants