Skip to content

Tomaxikz/Comment-remover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advanced Comment Remover v2.0

Ultra-fast, multi-threaded comment removal tool supporting 15+ programming languages.

Features

  • Multi-threaded processing - Utilizes all CPU cores
  • 15+ languages - JS, TS, Python, Rust, Go, C, C++, C#, Java, Kotlin, PHP, Ruby, Swift, Scala, Dart
  • Smart parsing - Preserves strings, regex, multiline strings
  • Safe operation - State machine parser prevents false positives
  • Interactive UI - Beautiful console interface with file selection
  • Production ready - Zero errors, handles all edge cases

Supported Languages

Language Extensions Line Comment Block Comment
JavaScript js, jsx, mjs, cjs // /* */
TypeScript ts, tsx // /* */
Python py, pyw, pyi # """ """
Rust rs // /* */
Go go // /* */
C c, h // /* */
C++ cpp, cc, cxx, hpp // /* */
C# cs // /* */
Java java // /* */
Kotlin kt, kts // /* */
PHP php, phtml // /* */
Ruby rb, rake # =begin =end
Swift swift // /* */
Scala scala, sc // /* */
Dart dart // /* */

Installation

cargo build --release

Usage

cargo run --release

Follow the interactive prompts:

  1. Choose directory to scan
  2. Select files to process
  3. Confirm operation
  4. View results

How It Works

Uses a state machine parser that tracks:

  • Code state
  • String literals (with escape sequences)
  • Regex patterns (JS/TS)
  • Multiline strings
  • Line comments
  • Block comments

Automatically skips:

  • node_modules, target, dist, build
  • .git, .svn, .hg
  • pycache, venv, vendor

Performance

  • Multi-threaded processing across all CPU cores
  • Optimized release build with LTO
  • Processes 1000+ files in seconds

Safety

  • Preserves all code functionality
  • Never removes comments inside strings
  • Handles escaped characters correctly
  • Detects regex context in JS/TS
  • Maintains file structure and newlines

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages