Re: [PATCH] perf build: Specify that spellcheck should use the bash dialect.
From: Collin Funk
Date: Mon Jun 23 2025 - 22:08:57 EST
Hi Ian,
Ian Rogers <irogers@xxxxxxxxxx> writes:
>> > $ find tools/perf -name Build | xargs grep bash
>> > tools/perf/Build: $(Q)$(call echo-cmd,test)shellcheck -s bash -a -S warning "$<" > $@ || (cat $@ && rm $@ && false)
>> > tools/perf/trace/beauty/Build: $(Q)$(call echo-cmd,test)shellcheck -s bash -a -S warning "$<" > $@ || (cat $@ && rm $@ && false)
>> >
>> > Collin
>>
>> In that case:
>>
>> Reviewed-by: James Clark <james.clark@xxxxxxxxxx>
>>
>> And I'll send the bulk hashbang change separately.
>
> I've no objection to switching to using bash globally. It seems
> sub-optimal that we've copy-pasted the shellcheck command across many
> different Build files and that this patch will cause the
> tools/perf/tests/Build one to differ. My preference would be to have a
> global definition probably in Makefile.perf, then use it consistently.
> Alternative all shellcheck invocations can pass "-s bash" for the sake
> of consistency. Fwiw, I think the 'tools/arch/x86/tools/gen-insn-*'
> which is to some extent taken from the kernel's 'arch/x86/tools' is
> okay with the change too.
Good point. It turns out there was a SHELLCHECK variable in
Makefile.perf, but it was not used consistently.
I have submitted V2 that adds the '-s bash' option to the definition and
actually uses the variable [1]
Collin
[1] https://lore.kernel.org/all/f7ea3a430dc2bd77656c50f93283547d1245e2fe.1750730589.git.collin.funk1@xxxxxxxxx/