public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v2 1/1] editorconfig: add consistent formatting rules for LTP
@ 2026-03-16 13:03 Jan Polensky
  2026-03-27 10:53 ` Andrea Cervesato via ltp
  0 siblings, 1 reply; 12+ messages in thread
From: Jan Polensky @ 2026-03-16 13:03 UTC (permalink / raw)
  To: chrubis, pvorel; +Cc: Linux Test Project

Introduce .editorconfig to keep indentation and whitespace consistent across
editors, preventing accidental reformatting and noisy diffs.

Signed-off-by: Jan Polensky <japo@linux.ibm.com>
---

Changes since v1 (thanks Petr):
- License identifier: GPL-2.0 -> GPL-2.0-or-later
- Drop awk
- Treat Python/Perl special files
- indent_size=4 for *.{c,h,S,sh} and ver_linux
- Fix indent_size for .rst/.md to 4

 .editorconfig | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 .editorconfig

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000000000000..ee67666d49c4
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,39 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+root = true
+
+# Default for all files
+[*]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+# C/Assembly source files, headers, and shell files use tabs
+[{*.{c,h,S,sh},ver_linux}]
+indent_style = tab
+indent_size = 4
+
+[{Makefile,Makefile.*,*.{mk.in,mk}}]
+indent_style = tab
+indent_size = 8
+
+# Python and Perl: default to tabs (most test files use tabs, checkpatch.pl which we modify)
+[*.{py,pl}]
+indent_style = tab
+indent_size = 8
+
+# Exceptions use spaces: Python (Sphinx, scripts), Perl (checkbashisms.pl vendored)
+[{doc/conf.py,scripts/*.py,scripts/checkbashisms.pl}]
+indent_style = space
+indent_size = 4
+
+# Documentation files
+[*.{rst,md}]
+indent_style = space
+indent_size = 4
+
+# JSON files
+[*.json]
+indent_style = space
+indent_size = 4
--
2.53.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-03-31 20:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-16 13:03 [LTP] [PATCH v2 1/1] editorconfig: add consistent formatting rules for LTP Jan Polensky
2026-03-27 10:53 ` Andrea Cervesato via ltp
2026-03-27 12:33   ` Petr Vorel
2026-03-27 13:39     ` Andrea Cervesato via ltp
2026-03-27 17:43       ` Petr Vorel
2026-03-27 18:25         ` Jan Polensky
2026-03-27 18:59           ` Petr Vorel
2026-03-27 15:29   ` Petr Vorel
2026-03-27 17:55     ` Jan Polensky
2026-03-27 18:25       ` Petr Vorel
2026-03-30  7:23     ` Andrea Cervesato via ltp
2026-03-31 19:59       ` Jan Polensky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox