Skip to content

chore: add pre-commit hooks and flake8-bandit ruff rules#170

Merged
Uno-Takashi merged 1 commit into
mainfrom
chore/add-pre-commit-ruff
Jun 21, 2026
Merged

chore: add pre-commit hooks and flake8-bandit ruff rules#170
Uno-Takashi merged 1 commit into
mainfrom
chore/add-pre-commit-ruff

Conversation

@Uno-Takashi

Copy link
Copy Markdown
Member

概要

pre-commit を導入し、ruff のルールに flake8 系プラグインを追加します。

変更点

  • .pre-commit-config.yaml(新規)
    • astral-sh/ruff-pre-commit@v0.15.18ruff-check --fix + ruff-format
    • pre-commit/pre-commit-hooks@v6.0.0 … whitespace / EOF / yaml / toml / json / merge-conflict / large-file
    • exclude: ^web/static/ で jQuery・Bootstrap・Flickity 等のベンダー minified 資産を整形対象外に
  • pyproject.toml — ruff select を拡張
    • W(pycodestyle 警告), Sflake8-bandit)を追加
    • 既存の E/F(flake8 本体), DJflake8-django), I/UP/B/C4 は維持
    • テスト / conftest.py では S101(assert)を除外
  • 自前管理ファイル(templates の html、各種 .gitignore 等)の行末・EOF 正規化(内容差分なし)

検証

  • pre-commit run --all-files → 全フック Passed
  • ruff check(S/W 含む, 33 ファイル)→ 違反ゼロ

🤖 Generated with Claude Code

Introduce a pre-commit configuration running ruff (lint + format) and the
standard pre-commit-hooks. Expand the ruff rule set to cover flake8 (E/W/F),
flake8-django (DJ) and flake8-bandit (S); ignore S101 in tests/conftest.

Vendored static assets under web/static/ are excluded from the generic
whitespace/EOF hooks. Hand-maintained files are normalised one-off.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Uno-Takashi Uno-Takashi merged commit b8efefe into main Jun 21, 2026
16 of 18 checks passed
@Uno-Takashi Uno-Takashi deleted the chore/add-pre-commit-ruff branch June 21, 2026 10:43
Uno-Takashi added a commit to d-party/d-party that referenced this pull request Jun 21, 2026
…ckend

- devcontainer: Python 3.14, Node 26, and `pre-commit install` for the
  backend submodule on create.
- bump backend submodule to include pre-commit + flake8-bandit ruff rules
  (d-party/backend#170).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Uno-Takashi added a commit to d-party/d-party that referenced this pull request Jun 21, 2026
…ckend (#3)

- devcontainer: Python 3.14, Node 26, and `pre-commit install` for the
  backend submodule on create.
- bump backend submodule to include pre-commit + flake8-bandit ruff rules
  (d-party/backend#170).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant