`make static-check` fails on master: Makefile uses --max-complexity=10, CI uses 11

オープン 初心者向け
#3,778 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
ci-cd, tooling

調査の方向性

.github/workflows/run-tests.yaml:53、Makefile:42、scripts/README.md:358を読み、CIとローカルチェックで使われている複雑度の上限を比較してください。ドキュメントに記載されている2つのローカルコマンドを更新してCIの上限に合わせ、その後 make static-check を実行してください。CIと同様に正常終了すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Describe the bug
make static-check fails on a clean master checkout. CI's flake8 step was moved to --max-complexity=11 in 022bdeb8 (.github/workflows/run-tests.yaml:53), but Makefile:42 and the Windows command in scripts/README.md:358 still use 10. Two functions are now at 11, so CI passes while the local check fails. scripts/README.md also suggests running make static-check from a pre-commit hook, and that hook currently blocks every commit.

To Reproduce

  1. Check out master (94d0d878)
  2. Run make static-check
  3. See:
./scripts/convert.py:999:1: C901 'get_template_for_edition' is too complex (11)
./scripts/pdf_generation/merge_pdfs.py:327:1: C901 'main' is too complex (11)
make: *** [static-check] Error 1

Expected behavior
make static-check passes whenever CI's lint step passes.

Desktop

  • OS: macOS, Docker 29.9.2

Additional context
Setting 11 in Makefile:42 and scripts/README.md:358 fixes it; make static-check then exits 0. If you'd rather keep 10, I can refactor the two functions instead. Could I be assigned?

主要言語
Python
スター
158
フォーク
110
平均マージ
1日 11時間
マージ済み PR(30日)
115

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

OWASP/cornucopia のほかの issue

OWASP/cornucopia の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。