Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

20 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ฅ YourMom Variable Fixer ๐Ÿ”ฅ

A universal command-line tool that finds terrible variable names in your codebase and replaces them with increasingly ridiculous variations of "YourMom". Because if you're going to have bad variable names, they might as well be memorable.

โœจ Features

  • Multi-language support: Works with 15+ programming languages
  • Smart detection: Identifies genuinely bad variable names (single letters, generic names, etc.)
  • Safe replacements: Uses word boundaries to avoid breaking your code
  • Flexible output: Create fixed files or modify in-place with optional backups
  • Dry run mode: Preview changes before applying them
  • Recursive processing: Handle entire directory trees

๐ŸŽฏ Supported Languages

  • Rust (.rs)
  • JavaScript/TypeScript (.js, .jsx, .ts, .tsx)
  • Python (.py)
  • Java (.java)
  • C/C++ (.c, .h, .cpp, .cc, .cxx, .c++)
  • C# (.cs)
  • Go (.go)
  • Ruby (.rb)
  • PHP (.php)
  • Kotlin (.kt)
  • Swift (.swift)
  • Dart (.dart)
  • Scala (.scala)

๐Ÿš€ Installation

From Source (Recommended)

# Clone the repository
git clone https://github.com/Mr615-TN/bad_variable_changer.git
cd bad_variable_changer

# Build the release binary
cargo build --release

# The binary will be in target/release/yourmom-fixer
# Copy it to your PATH for global access
cp target/release/bad_variable_changer /usr/local/bin/

Using Cargo

cargo install --git https://github.com/Mr615-TN/bad_variable_changer.git

๐ŸŽฎ Usage

Basic Usage

# Process specific files (creates .fixed versions)
bad_variable_changer main.py utils.js

# Process files in-place with backups
bad_variable_changer -i -b src/main.rs src/lib.rs

# Process entire directory recursively
bad_variable_changer -r ./my-project

# Preview changes without modifying files
bad_variable_changer --dry-run -r ./src

Advanced Usage

# Process multiple directories with different options
bad_variable_changer -i -r -b ./frontend ./backend ./shared

# Process only specific file types in current directory
bad_variable_changer *.py *.js *.rs

# Safe exploration of a new codebase
bad_variable_changer --dry-run -r ./downloaded-project

๐ŸŽญ What Gets Replaced

Bad Variable Names Detected:

  • Single letters: i, j, k, a, b, c, etc.
  • Generic names: temp, tmp, var, data, item, elem, node, obj
  • Names with numbers: var1, item2, data3
  • Really short meaningless names: aa, bb, cc

YourMom Variations Used:

yourmom โ†’ yOurMom โ†’ YourMom โ†’ yourMom โ†’ YOURMOM
YouRmOm โ†’ yOuRmOm โ†’ YoUrMoM โ†’ yourmOM โ†’ YOURmom
YoUrMoThEr โ†’ yourmother โ†’ YourMother โ†’ YOURMOTHER
yOuRmOtHeR โ†’ yourmommy โ†’ YourMommy โ†’ YOURMOMMY
urmom โ†’ UrMom โ†’ URMOM โ†’ yomama โ†’ YoMama โ†’ YOMAMA

๐Ÿ“– Command Line Options

OPTIONS:
    -i, --in-place      Modify files in place instead of creating .fixed files
    -r, --recursive     Process directories recursively
    -b, --backup        Create .backup files when using --in-place
    --dry-run           Show what would be changed without modifying files
    -h, --help          Show help message

EXAMPLES:
    bad_variable_changer main.rs lib.py                    # Process specific files
    bad_variable_changer -i -b src/                        # Process src/ in-place with backups
    bad_variable_changer -r .                              # Process all source files recursively
    bad_variable_changer --dry-run -r ./project            # Preview changes without modifying

๐ŸŽฏ Example Transformations

Python Before:

def calculate_something(a, b):
    temp = a * b
    for i in range(10):
        data = temp + i
        if data > 50:
            return data
    return temp

Python After:

def calculate_something(yourmom, yOurMom):
    YourMom = yourmom * yOurMom
    for yourMom in range(10):
        YOURMOM = YourMom + yourMom
        if YOURMOM > 50:
            return YOURMOM
    return YourMom

JavaScript Before:

const items = [1, 2, 3];
let temp = 0;
for (let i = 0; i < items.length; i++) {
    const val = items[i];
    temp += val;
}

JavaScript After:

const items = [1, 2, 3];
let yourmom = 0;
for (let yOurMom = 0; yOurMom < items.length; yOurMom++) {
    const YourMom = items[yOurMom];
    yourmom += YourMom;
}

๐Ÿ›ก๏ธ Safety Features

  • Word boundary matching: Won't partially replace variable names
  • Language-aware: Uses appropriate patterns for each programming language
  • Backup creation: Optional backup files when modifying in-place
  • Dry run mode: Preview changes before applying
  • Skip already fixed: Won't replace existing "yourmom" variations

๐Ÿค” Why Use This?

  1. Educational: Learn to write better variable names by seeing how ridiculous bad ones look
  2. Code review prep: Make terrible legacy code memorable before refactoring
  3. Team building: Bring some humor to your debugging sessions
  4. Refactoring aid: Easily spot which variables need proper names
  5. Because it's hilarious: Sometimes you need to laugh at your code

๐ŸŽช Language-Specific Features

The tool understands different language patterns:

  • Python: Handles list comprehensions, lambda functions, with statements
  • JavaScript: Supports arrow functions, destructuring, modern syntax
  • Rust: Recognizes pattern matching, closures, ownership patterns
  • Java: Handles enhanced for loops, generics, method signatures
  • Go: Understands Go's unique syntax and conventions
  • And many more!

๐Ÿšง Building from Source

Prerequisites

Build Steps

git clone https://github.com/Mr615-TN/bad_variable_changer.git
cd bad_variable_changer
cargo build --release

The optimized binary will be at target/release/bad_variable_changer.

Development

# Run in development mode
cargo run -- --help

# Run tests
cargo test

# Format code
cargo fmt

# Check for issues
cargo clippy

๐Ÿค Contributing

Contributions welcome! Areas for improvement:

  • Add support for more programming languages
  • Improve variable detection patterns
  • Add more YourMom variations
  • Better handling of edge cases

๐Ÿ“œ License

GPL-3.0 - see LICENSE file for details.

โš ๏ธ Disclaimer

This tool is intended for educational and entertainment purposes. While it's designed to be safe, always backup your code before running it on important projects. The authors are not responsible for any code that becomes sentient and starts insulting your mother.

๐ŸŽ‰ Fun Stats

After processing your codebase, you'll have:

  • โœ… More memorable variable names
  • โœ… A good laugh during code reviews
  • โœ… Easy identification of variables that need proper names
  • โœ… The most unique codebase in your organization

"Your code may be bad, but at least now it's hilariously bad." - YourMom Variable Fixer

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages