Stripr can find and remove those nasty (debug) comments you left in your code, because why not?
- Only supports C-style comments
- Only supports flat directories (no subdirectories)
You can install stripr using Homebrew if you're on macOS or Linux. You can install Homebrew here.
brew tap aosasona/stripr
This will add the tap to your Homebrew installation so you can install the latest version of Stripr using the following command:
brew install stripr
Stripr has been written in Golang which is a compiled language, so you will need to install the Golang compiler to build the binary or you can get a pre-built binary for your machine from this link (Linux, Windows, macOS) and extract them to your PATH.
If you would like to build the binary yourself, you can do so by running the following command:
make build-release
OR
make build-auto
The build-release
will build the binary for your current OS and architecture and place it in the release
directory and build-auto
will do the same but place it in the build directory with a sub-folder named after your OS and architecture. By default, the build
folder is set to ignored by git for this project but you can build for ALL platforms locally by running the following command:
make build-all
You could tinker with the Makefile to build for other platforms, but I have not tested it outside Unix at the moment, let me know if you have any issues.
stripr [options] [command]
Example:
stripr -target=./example -skip-check -show-stats strip
-
-target=string
The directory or file to read (default "." - current directory) -
-show-stats=true|false
Show the number of files and lines that will be affected -
-skip-check=true|false
Skip the confirmation prompt before stripping comments
-
init
Create a config file in the current directory -
scan
Scan the directory for comments -
strip
|clean
Remove comments from the directory (-skip-check to prevent asking for confirmation; use with caution)help
Show the help message
You can contribute to this project by opening an issue or a pull request, I will try to respond as soon as possible. This was a fun little project to work on to learn Golang and I hope you find it useful at some point.