[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bab3ecae932cb41106834156abbd27159d937e67.camel@perches.com>
Date: Thu, 01 Oct 2020 11:47:06 -0700
From: Joe Perches <joe@...ches.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andy Whitcroft <apw@...onical.com>,
LKML <linux-kernel@...r.kernel.org>,
"kernel-mentors@...enic.com" <kernel-mentors@...enic.com>,
kernelnewbies <kernelnewbies@...nelnewbies.org>
Subject: external tool to remove embedded filenames
It's rather unnecessary for files to contain their
path/filename in source code comments.
Here's a trivial little script that can remove
embedded filenames in c90 style comments from files.
This requires git.
It does the following types of removals:
remove individual lines like /* filename */ completely
remove filename from /* filename -- comment */, leave /* comment */
remove filename and any trailing ' *\n' from /* filename, leave /*
remove filename from /* filename, leave /*
remove filename from continuation ' * filename -- comment' leave ' * comment'
remove filename and any trailing ' *\n' from continuation ' * filename\n *\n'
It seems to work well enough.
It does not handle c99 comments.
No // filename variants are removed.
Running it on today's -next gives:
$ perl remove_embedded_filenames.pl
$ git diff --shortstat
2310 files changed, 354 insertions(+), 4239 deletions(-)
It's also possible to give any filename or path
as an argument to the script
For instance:
$ perl remove_embedded_filenames.pl drivers/net
Download attachment "remove_embedded_filenames.pl" of type "application/x-perl" (2615 bytes)
Powered by blists - more mailing lists