Skip to content

anandukch/comet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Comet: Code Comment Management CLI

Comet is a command-line tool for scanning, managing, and documenting code comments across multiple languages. It helps developers detect, remove, or export comments with ease—keeping code clean, consistent, and well-documented.


Features

  • Multi-Language Support: Detects comments in various programming languages (Go, Python, C, and more) based on file type.
  • Automatic Documentation: Saves all comments in a structured format in comments.txt, including file paths and line numbers.
  • Optional Comment Removal: Prompts you to remove comments during the scan process, with a simple "yes/no" option.
  • Directory Scanning: Easily scan an entire project or specific directory for comments.

📂 Supported Languages & Comment Syntax

Comet automatically identifies comments based on file type, using the correct delimiter:

Language Extension Comment Syntax
Go .go //
Python .py #
C .c //, /*...*/
Java .java //, /*...*/

Additional languages can be easily configured as needed.


🔧 Installation

  1. Clone the Repository

    git clone https://github.com/anandukch/comet.git
    cd comet
  2. Install Dependencies Ensure you have Go installed on your system. Run:

    go mod tidy
  3. Build the CLI

    go build
    

🛠 Usage

Basic Usage

Run Comet to scan for comments in the current directory:

./comet

Scan a Specific Directory

Provide a project path to scan for comments in that specific folder:

./comet /path/to/your/project

Generated Documentation

After scanning, Comet will generate a comments.txt file in the project root with a structured list of comments:

/path/to/your/file.go
Line 3: // This is a comment
Line 15: // Another comment

/path/to/your/file.py
Line 8: # Python comment example

Comment Removal

When prompted, you can remove all detected comments by typing "y" (or keep them by typing "n"). This removes comments directly from the files scanned.

🤖 Example Output

Starting comment scan in directory: /path/to/your/project
Comment found at /path/to/your/file.go:3 - // Initial setup
Comment found at /path/to/your/file.go:15 - // Deprecated function

Would you like to remove the comments? (y/n): y
Comments removed and saved to comments.txt

About

Code Comment Management CLI Tool

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages