Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direct inclusion of used headers #1873

Closed
wants to merge 3 commits into from

Conversation

MichaelChirico
Copy link
Contributor

As flagged by clang-tidy's misc-include-cleaner:

https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html

@DavisVaughan
Copy link
Member

We purposefully use vctrs.h as a megaheader that includes most useful headers you might want to use when developing new algorithms. It already includes proxy.h and size.h, for example.

@MichaelChirico
Copy link
Contributor Author

Thanks... I wonder if CRAN will ever move towards stricter inclusion rules.

Myself, I've become more of a fan of the stricter rules after dealing with all sorts of Depends/Imports headaches this year. The "megaheader" approach reminds me of Depends and all the associated hassle.

Anyway it seems the R headers themselves need some cleanup / I don't have a good environment to debug this PR right now, so I'll close.

@MichaelChirico MichaelChirico deleted the headers branch August 23, 2023 21:12
@DavisVaughan
Copy link
Member

@lionel- and I definitely fought over whether to use a megaheader vs very strict include-what-you-use type of rules in the past 😆

@lionel-
Copy link
Member

lionel- commented Aug 23, 2023

The "megaheader" approach reminds me of Depends and all the associated hassle.

I think a better analogy is that the one header per file approach is like creating a different package for each .R file.

Maybe this could help? https://clangd.llvm.org/design/include-cleaner#umbrella-headers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants