Allow using Cobertura XML report in incremental mode

オープン
#9,041 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
tooling

調査の方向性

まず、--cobertura-xml-report に対する mypy のエントリーポイントと、issue #6076 で説明されているインクリメンタルモードの動作を追跡します。mypy と diff-cover を使った tox の例を検証し、このユースケースで Cobertura XML レポートを生成してもインクリメンタルモードが無効にならなくなった時点で作業完了とします。

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

説明

feature priority-2-low

I'm trying to use diff-cover with mypy to enforce any new code to have type annotations. Here's what I use (via tox):

mypy --cobertura-xml-report {envtmpdir} qutebrowser tests {posargs}
diff-cover --fail-under=100 --compare-branch={env:DIFF_BRANCH:origin/{env:GITHUB_BASE_REF:master}} {envtmpdir}/cobertura.xml

That does seem to work fine - however, due to #6076 (cc @mthuurne), it disables incremental mode (causing the runtime of mypy to go up from <1s to ~15s). Note that in my case I don't care about the XML report only containing changed files, because those are the only ones actually relevant for the annotation coverage diff - thus, I think it would be fine to enable the cache for this use-case.

I understand if this is a too specific case, though - I wonder if it'd make sense to have some "enforce annotations for any new code" functionality in mypy itself (perhaps via the incremental mode)?

主要言語
Python
スター
20.6k
フォーク
3.3k
平均マージ
1日 18時間
マージ済み PR(30日)
54

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

python/mypy のほかの issue

python/mypy の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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