From 0facd93e7b41e7d21e48e38330695057df23b0f9 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Mon, 1 Jun 2026 16:05:42 -0400 Subject: [PATCH] chore: linting drift Signed-off-by: Henry Schreiner --- .github/workflows/doc.yml | 2 +- doc/changelog.qbk | 2 +- examples/guide_custom_axis_multiple_value_types.cpp | 4 +--- examples/guide_fill_histogram.cpp | 2 +- include/boost/histogram/accumulators/collector.hpp | 4 +++- include/boost/histogram/detail/term_info.hpp | 5 +++-- include/boost/histogram/literals.hpp | 2 +- include/boost/histogram/utility/clopper_pearson_interval.hpp | 3 ++- test/detail_array_wrapper_serialization_test.cpp | 2 +- 9 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 094cbde0..092175b4 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -22,7 +22,7 @@ jobs: steps: - uses: actions/setup-python@v5 with: - python-version: '3.12' + python-version: '3.12' - name: Install docbook dependencies run: | diff --git a/doc/changelog.qbk b/doc/changelog.qbk index 56869615..f4e6fae2 100644 --- a/doc/changelog.qbk +++ b/doc/changelog.qbk @@ -48,7 +48,7 @@ * Replace `detail::span` and `detail::make_span` with implementations in `boost::core` * Documentation improvements * Protect usage of `std::min` and `std::max` in some cases, contributed by Han Jiang (min,max macros are illegially set by popular Windows headers so we need to work around) -* Added test to catch usage of unprotected min,max tokens in the library in the future +* Added test to catch usage of unprotected min,max tokens in the library in the future * Fixes to support latest clang-14 and deduction guides in gcc-11+ [heading Boost 1.81] diff --git a/examples/guide_custom_axis_multiple_value_types.cpp b/examples/guide_custom_axis_multiple_value_types.cpp index 74bd7f8e..852d5092 100644 --- a/examples/guide_custom_axis_multiple_value_types.cpp +++ b/examples/guide_custom_axis_multiple_value_types.cpp @@ -31,9 +31,7 @@ struct my_axis : axis::regular { converter_type(double x) : val_{x} {} }; - axis::index_type index(converter_type x) const { - return base_type::index(x.val_); - } + axis::index_type index(converter_type x) const { return base_type::index(x.val_); } }; int main() { diff --git a/examples/guide_fill_histogram.cpp b/examples/guide_fill_histogram.cpp index f70b3b98..5e1eb6c3 100644 --- a/examples/guide_fill_histogram.cpp +++ b/examples/guide_fill_histogram.cpp @@ -6,8 +6,8 @@ //[ guide_fill_histogram -#include #include +#include #include #include #include diff --git a/include/boost/histogram/accumulators/collector.hpp b/include/boost/histogram/accumulators/collector.hpp index b800732e..2f84a0b1 100644 --- a/include/boost/histogram/accumulators/collector.hpp +++ b/include/boost/histogram/accumulators/collector.hpp @@ -43,7 +43,9 @@ class collector { explicit collector(Args&&... args) : container_(std::forward(args)...) {} // make template only match if forwarding args to container is valid - template (),std::declval()...))> + template (), + std::declval()...))> explicit collector(std::initializer_list list, Args&&... args) : container_(list, std::forward(args)...) {} diff --git a/include/boost/histogram/detail/term_info.hpp b/include/boost/histogram/detail/term_info.hpp index 8eb19666..948b60ef 100644 --- a/include/boost/histogram/detail/term_info.hpp +++ b/include/boost/histogram/detail/term_info.hpp @@ -69,9 +69,10 @@ inline bool utf8() { inline int width() { int w = 0; #if defined TIOCGWINSZ - struct winsize ws{}; + struct winsize ws {}; if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) == 0) - w = (std::max)(static_cast(ws.ws_col), 0); // not sure if ws_col can be less than 0 + w = (std::max)(static_cast(ws.ws_col), + 0); // not sure if ws_col can be less than 0 #endif env_t env("COLUMNS"); const int col = (std::max)(static_cast(env), 0); diff --git a/include/boost/histogram/literals.hpp b/include/boost/histogram/literals.hpp index 02ce9a39..7e51bef4 100644 --- a/include/boost/histogram/literals.hpp +++ b/include/boost/histogram/literals.hpp @@ -23,7 +23,7 @@ constexpr unsigned parse_number(unsigned n, char f, Rest... rest) { namespace literals { /// Suffix operator to generate literal compile-time numbers, 0_c, 12_c, etc. template -auto operator ""_c() { +auto operator""_c() { return std::integral_constant(); } } // namespace literals diff --git a/include/boost/histogram/utility/clopper_pearson_interval.hpp b/include/boost/histogram/utility/clopper_pearson_interval.hpp index 947c9464..613fdc69 100644 --- a/include/boost/histogram/utility/clopper_pearson_interval.hpp +++ b/include/boost/histogram/utility/clopper_pearson_interval.hpp @@ -54,7 +54,8 @@ class clopper_pearson_interval : public binomial_proportion_interval @param successes Number of successful trials. @param failures Number of failed trials. */ - interval_type operator()(value_type successes, value_type failures) const noexcept override { + interval_type operator()(value_type successes, + value_type failures) const noexcept override { // analytical solution when successes or failures are zero // T. Mans (2014), Electronic Journal of Statistics. 8 (1): 817-840. // arXiv:1303.1288. doi:10.1214/14-EJS909. diff --git a/test/detail_array_wrapper_serialization_test.cpp b/test/detail_array_wrapper_serialization_test.cpp index 1446fa65..9aa5d853 100644 --- a/test/detail_array_wrapper_serialization_test.cpp +++ b/test/detail_array_wrapper_serialization_test.cpp @@ -25,7 +25,7 @@ struct dummy_array_wrapper { std::size_t size; template void serialize(Archive& ar, unsigned /* version */) { - for (auto&& x : boost::make_span(ptr, size)) ar & x; + for (auto&& x : boost::make_span(ptr, size)) ar& x; } };