From 73c3457dcaca11225594e0d88f98a339cd819de1 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Tue, 11 Jun 2024 21:46:47 +0200 Subject: [PATCH] editorconfig: leave patch files alone wrt trainling spaces It is perfectly valid for a patch file to have trailing spaces, when for example an empty or space-only line is appears in a hunk: if the line if part of the context, whether it be empty or with only spaces, there will aways be the leading space introduced by the patch itsef, making for a sapce-only line; if the line is space-only and removed (or added) that will also appear as a space-only line. Currently, our editorconfig wants to unconditionally drop trailing spaces, so when one edits a patch file to add their SoB and Upstream tags, such a patch would get badly mangled and would not apply, causing quite some grief and questioning (sad experience looming in the recent past here)... Signed-off-by: Yann E. MORIN (cherry picked from commit 85736a27c8cdddcc65ff769852fde60834f302c7) Signed-off-by: Peter Korsgaard --- .editorconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.editorconfig b/.editorconfig index af6cf4b449..f7c3c7ddc3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -29,6 +29,9 @@ indent_size = tab indent_style = tab indent_size = tab +[*.patch] +trim_trailing_whitespace = false + [S{0..9}{0..9}*] indent_style = tab indent_size = tab