Skip to content

Uniform header inclusion#1343

Merged
AntoinePrv merged 5 commits into
xtensor-stack:masterfrom
AntoinePrv:headers
May 13, 2026
Merged

Uniform header inclusion#1343
AntoinePrv merged 5 commits into
xtensor-stack:masterfrom
AntoinePrv:headers

Conversation

@AntoinePrv
Copy link
Copy Markdown
Contributor

No description provided.

@serge-sans-paille
Copy link
Copy Markdown
Contributor

serge-sans-paille commented May 10, 2026

That's cool, but you also need to write some rule to ensure we don't regress on those, otherwise we're going to repeatedly hit this.

I think I prefer having standard header include last, as a way to detect some missing includes hidden by transitive inclusion. This can be enforced by the following clang-format option:

IncludeBlocks: Regroup
IncludeCategories:
  - Regex:           '"\.\.?/.*"'
    Priority:        2
    SortPriority:    2
  - Regex:           '<.*'
    Priority:        3

@AntoinePrv
Copy link
Copy Markdown
Contributor Author

@serge-sans-paille this should be good now, though slightly larger.
I added the clang-format rule.

@DiamonDinoia
Copy link
Copy Markdown
Contributor

DiamonDinoia commented May 13, 2026

I recently also added support for clang-tidy include what you use: flatironinstitute/finufft@67f0e7c

What so you think about incorporating it here?

If this is noise, feel free to discard the suggestion :-)

#ifdef XSIMD_ENABLE_XTL_COMPLEX
template <typename T, bool i3ec, size_t N>
struct has_simd_register<xtl::complex<T, T, i3ec>, emulated<N>> : std::true_type
struct has_simd_register<xtl::xcomplex<T, T, i3ec>, emulated<N>> : std::true_type
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how did we miss that one?

Copy link
Copy Markdown
Contributor Author

@AntoinePrv AntoinePrv May 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed ! That why maybe randomized CI settings might be helpful to explore the combinatorial mix of settings. It could be done in a CRON job.

Copy link
Copy Markdown
Contributor

@serge-sans-paille serge-sans-paille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very happy with the automation of that task \o/

@AntoinePrv AntoinePrv merged commit 365b353 into xtensor-stack:master May 13, 2026
87 checks passed
@AntoinePrv AntoinePrv deleted the headers branch May 13, 2026 16:19
@AntoinePrv
Copy link
Copy Markdown
Contributor Author

I recently also added support for clang-tidy include what you use: flatironinstitute/finufft@67f0e7c

What so you think about incorporating it here?

@DiamonDinoia I also very much want to have this in xsimd, but I am logging out for the next couple days. I'll merge this one so that it does not get outdated. Feel free to send a PR if mine does not come soon enough :)

@DiamonDinoia
Copy link
Copy Markdown
Contributor

I recently also added support for clang-tidy include what you use: flatironinstitute/finufft@67f0e7c
What so you think about incorporating it here?

@DiamonDinoia I also very much want to have this in xsimd, but I am logging out for the next couple days. I'll merge this one so that it does not get outdated. Feel free to send a PR if mine does not come soon enough :)

No worries! I am about to logout for ~2 weeks :)

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