From: Jules Maselbas <jmaselbas@kalray.eu>
To: musl@lists.openwall.com
Cc: Jules Maselbas <jmaselbas@kalray.eu>
Subject: [musl] [PATCH 1/2] tools: Add a script to remove trailing spaces
Date: Tue, 3 May 2022 17:56:54 +0200 [thread overview]
Message-ID: <20220503155655.11222-1-jmaselbas@kalray.eu> (raw)
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>
---
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..a8b0056a
--- /dev/null
+++ b/tools/remove-trailing-space.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+git grep '[[:space:]]$' -- $@ | sed 's/:.*//' | uniq | xargs sed -i 's/[[:space:]]\+$//'
--
2.17.1
next reply other threads:[~2022-05-03 15:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-03 15:56 Jules Maselbas [this message]
2022-05-03 15:56 ` [musl] [PATCH 2/2] Remove trailing whitespaces tree-wide Jules Maselbas
2022-05-03 16:17 ` Jeffrey Walton
2022-05-03 17:14 ` Rich Felker
2022-05-03 16:29 ` Khem Raj
2022-05-03 16:30 ` [musl] [PATCH 1/2] tools: Add a script to remove trailing spaces Khem Raj
2022-05-04 6:06 ` Patrick Oppenlander
2022-05-04 8:20 ` Jules Maselbas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220503155655.11222-1-jmaselbas@kalray.eu \
--to=jmaselbas@kalray.eu \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).