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

Aberta
#3,474 1 comentário 1 reação 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
35/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
cpp

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
C++
Estrelas
845
Forks
225
Merge médio
4d 21h
PRs com merge (30d)
13

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de stan-dev/math

Todas as issues de stan-dev/math

Issues semelhantes

Mais issues de C++

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.