https://github.com/junnishimura/konmari
CLI tool to delete code comment
https://github.com/junnishimura/konmari
cli go golang
Last synced: about 1 year ago
JSON representation
CLI tool to delete code comment
- Host: GitHub
- URL: https://github.com/junnishimura/konmari
- Owner: JunNishimura
- License: mit
- Created: 2023-06-02T15:26:14.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-18T14:15:39.000Z (over 1 year ago)
- Last Synced: 2025-02-18T15:27:04.914Z (over 1 year ago)
- Topics: cli, go, golang
- Language: Go
- Homepage:
- Size: 66.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# konmari / CLI tool to delete code comments
## 📖 Overview
konmari is a CLI tool that allows you to delete comments in source code in bulk.
## 💻 Installation
### Homebrew Tap
```
brew install JunNishimura/tap/konmari
```
### go intall
```
go install github.com/JunNishimura/konmari@latest
```
## 🔨 Options
```console
$ konmari -h
clean up source code comments
Usage:
konmari [flags]
Flags:
-h, --help help for konmari
-o, --overwrite overwrite existing files
-p, --postfix string postfix for cleaned files
```
### `-o`, `--overwrite`
By default, konmari outputs the result of comment deletion to a separate file. However, by specifying this option, existing files can be overwritten.
### `-p`, `--postfix`
Specify the postfix of the file that is the output destination of the comment deletion result.
## 👀 Example
To apply konmari to the following main.go file,
```go:main.go
package main
// import package
import "fmt"
/*
this is a test go file
*/
// main function
func main() {
fmt.Println("Hello, Wolrd") // print out hello world
}
```
The output will look like this
```go:main.go
package main
import "fmt"
func main() {
fmt.Println("Hello, Wolrd")
}
```
## 😢 Limitation
konmari has flows. konmari does not work as expected in the following case.
```go:main.go
package main
// import package
import "fmt"
// main function
func main() {
fmt.Println("this // will be treated as comment") // print out hello world
}
```
This is the output.
```go:main.go
package main
import "fmt"
func main() {
fmt.Println("this
}
```
konmari incorrectly recognizes comment symbols in strings as comments as well. This will be fixed in the future, so please be patient.
## 🪧 License
konmari is released under MIT License. See [MIT](https://raw.githubusercontent.com/JunNishimura/konmari/main/LICENSE)