Suggestion: Have the CI warn about or remove unused includes.

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

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp

調査の方向性

Read PR #3470 for the redundant include cleanup and inspect the existing Clang tooling used by CI. Determine how it handles namespace-only includes and bulk include headers, then consider the ordering constraints for external libraries. Done means CI can warn about or remove redundant includes with suitable exceptions; alphabetizing includes is a related idea that also needs order-aware grouping.

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

説明

Inspired by my recent PR #3470 which does a sweeping cleanup of redundant includes.

I think the CI in theory should be able to handle this automatically and either straight up remove the redundant includes at least give the submitter some sort of warning. Clang has some of this functionality and is already in use.

This may be tricky in some cases however, for example there are files where the only thing the include is necessary for is a namespace and of course there are the bulk include header files whose sole purpose is to have redundant includes. So this may need some more nuance configuration which I'm not sure how to do exactly. See #3470 for some more details.

Another idea: It would be nice to have the includes sorted alphabetically, but there are some cases where it's actually order dependent, especially when including libraries outside math, so again this can't be done in the most straightforward way and perhaps needs some grouping of includes.

主要言語
C++
スター
845
フォーク
225
平均マージ
3日 9時間
マージ済み PR(30日)
12

環境構築

はじめの一歩

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

stan-dev/math のほかの issue

stan-dev/math の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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