Preventing code quality regressions
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 5.1k
- フォーク
- 2.1k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 82
説明
For some time now we've used pyright's stricter configuration to prevent code quality regressions. Unless a stubs package is mentioned in the config file, it's expected to have annotations for all its fields. While this has served us well for a while, it has become unsuitable since the introduction of _typeshed.Incomplete:
- pyright doesn't understand that a (partial)
Incompleteannotation is equivalent (for our purposes) to an unannotated item. - It's tedious to maintain the pyright stricter configuration in addition to the metadata in the stubs directory.
- It's easy to cheat the regression check by using
Incomplete.
To improve the situation, I propose to move to a custom solution:
- Add an
incompletemarker toMETADATA.toml(defaulting tofalse). - Add a custom script to CI that checks that a stub package marked as complete can't have any incomplete (unannotated or using
Incomplete) fields. Alternatively, we could add a disabled-by-default check to flake8-pyi and use that instead. - At a later date, we could also add a PR CI script that add a PR comment warning a user if the amount of incomplete increases due to a PR.
(See also https://alexwaygood.github.io/typeshed-stats/.)
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、METADATA.toml にある stub パッケージのメタデータと、pyright のより厳格な設定を使用している現在の CI チェックを確認します。カスタム CI スクリプトを実装する場合と、提案されているデフォルトで無効な flake8-pyi チェックを比較します。完了の条件は、完全なパッケージに注釈のないフィールドや _typeshed.Incomplete を使用するフィールドを含められず、不完全マーカーのデフォルト値が false になっていることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- ci-cd, tooling
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100