[LTP] [PATCH v2 1/1] editorconfig: add consistent formatting rules for LTP
Jan Polensky
japo@linux.ibm.com
Fri Mar 27 18:55:05 CET 2026
On Fri, Mar 27, 2026 at 04:29:52PM +0100, Petr Vorel wrote:
> ...
> > > # Python and Perl: default to tabs (most test files use tabs, checkpatch.pl which we modify)
> > > [*.{py,pl}]
> > > indent_style = tab
> > > indent_size = 8
>
> > Not 100% sure about this.
>
> > The Python test files in the tree (e.g. pm_sched_domain.py, pm_ilb_test.py)
> > all use 4-space indentation, not tabs. The default for *.py should be
> > indent_style = space / indent_size = 4. Perl (checkpatch.pl) does use tabs,
> > so it should get its own section.
>
> > Also kirk uses 4 tabs indentation. So I guess we need to invert the two rules
> > at this point.
>
> Would it work if kirk has it's own .editorconfig? I mean, it should have anyway,
> but if it will be applied on it as a submodule.
>
> Kind regards,
> Petr
Hi Petr,
In upstream LTP, kirk is actually included as a git submodule at
`tools/kirk` (see `.gitmodules`), so having kirk carry its own
`.editorconfig` is a natural fit.
EditorConfig is directory-hierarchical: editors look for `.editorconfig`
files from the file’s directory upwards, and the closest matching
settings override parent ones. If kirk’s `.editorconfig` sets `root =
true`, the lookup stops at the submodule root, so LTP’s top-level rules
won’t affect files inside `tools/kirk`.
Alternatively, if one prefer a single policy file, one could keep
everything in LTP’s top-level `.editorconfig` and add a dedicated
override section like `[tools/kirk/**]`.
Kind regards,
Jan
More information about the ltp
mailing list