mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] [PATCH v2 1/2] tools: Add a script to remove trailing spaces
@ 2022-05-04 12:24 Jules Maselbas
  2022-05-04 12:24 ` [musl] [PATCH v2 2/2] Remove trailing whitespaces tree-wide Jules Maselbas
  0 siblings, 1 reply; 2+ messages in thread
From: Jules Maselbas @ 2022-05-04 12:24 UTC (permalink / raw)
  To: musl; +Cc: Jules Maselbas

Add the remove-trailing-space.sh script, it will only consider files
tracked by git. Optionaly accept arguments to select the affected path.

Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
---
v2: use the --name-only option as suggested by Patrick Oppenlander

 tools/remove-trailing-space.sh | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100755 tools/remove-trailing-space.sh

diff --git a/tools/remove-trailing-space.sh b/tools/remove-trailing-space.sh
new file mode 100755
index 00000000..df3dc9da
--- /dev/null
+++ b/tools/remove-trailing-space.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+git grep --name-only '[[:space:]]$' -- "$@" | xargs sed -i 's/[[:space:]]\+$//'
-- 
2.17.1


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

end of thread, other threads:[~2022-05-04 12:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-04 12:24 [musl] [PATCH v2 1/2] tools: Add a script to remove trailing spaces Jules Maselbas
2022-05-04 12:24 ` [musl] [PATCH v2 2/2] Remove trailing whitespaces tree-wide Jules Maselbas

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).