From: sashiko-bot@kernel.org
To: "Ian Rogers" <irogers@google.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v1] perf clang-format: Prioritize Python.h and expand other categories
Date: Tue, 26 May 2026 21:46:55 +0000 [thread overview]
Message-ID: <20260526214655.C72251F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260526213911.3993710-1-irogers@google.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Python.h shares Priority 0 with the implicit main header, failing to guarantee it is strictly sorted first.
--
commit 68559f2bb53c7691fdfd5703129afea21a0050da
Author: Ian Rogers <irogers@google.com>
perf clang-format: Prioritize Python.h and expand other categories
This commit adds Python.h to the clang-format configuration with priority 0 to
ensure it is sorted first. It also expands the standard and system header
categories, shifting their priorities down to accommodate the changes.
> diff --git a/tools/perf/.clang-format b/tools/perf/.clang-format
> index 902b2f7456f61..68b1c073d070b 100644
> --- a/tools/perf/.clang-format
> +++ b/tools/perf/.clang-format
> @@ -2,19 +2,22 @@ BasedOnStyle: InheritParentConfig
> SortIncludes: true
> IncludeBlocks: Regroup
> IncludeCategories:
> + # Python.h must be first
> + - Regex: '^<Python\.h>'
> + Priority: 0
> # Implicitly the corresponding header for the C file has Priority 0
[Severity: Low]
Since the corresponding main header for the C file implicitly has Priority 0,
does assigning Priority 0 to Python.h guarantee it will always be sorted
first?
Because both share the same priority, they are placed in the same include
block and sorted alphabetically. While uppercase 'P' alphabetically precedes
most lowercase filenames, it might not provide the strict overriding
priority intended here.
Would it be safer to assign a negative priority (such as Priority: -1) to
Python.h to strictly guarantee it is placed before the main header?
Additionally, I noticed that the C Standard Library headers were shifted to
Priority 2, leaving Priority 1 completely unused:
> # C Standard Library Headers
> - - Regex: '^<(assert|complex|ctype|errno|fenv|float|inttypes|iso646|limits|locale|math|setjmp|signal|stdalign|stdarg|stdatomic|stdbool|stddef|stdint|stdio|stdlib|stdnoreturn|string|tgmath|threads|time|uchar|wchar|wctype)\.h>'
> - Priority: 1
> + - Regex: '^<(assert|complex|ctype|errno|fenv|float|inttypes|iso646|limits|locale|math|setjmp|signal|stdalign|stdarg|stdatomic|stdbit|stdbool|stdckdint|stddef|stdint|stdio|stdlib|stdnoreturn|string|tgmath|threads|time|uchar|wchar|wctype)\.h>'
> Priority: 2
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260526213911.3993710-1-irogers@google.com?part=1
next prev parent reply other threads:[~2026-05-26 21:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-26 21:39 [PATCH v1] perf clang-format: Prioritize Python.h and expand other categories Ian Rogers
2026-05-26 21:46 ` sashiko-bot [this message]
2026-05-26 22:42 ` [PATCH v2] " Ian Rogers
2026-05-26 22:48 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260526214655.C72251F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=irogers@google.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox