Skip to content

🧹 Professional repository cleanup utility - Remove backup files, fix naming conventions, and establish hygiene standards

License

Notifications You must be signed in to change notification settings

pvestal/repo-clean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧹 repo-clean

Professional repository cleanup utility for developers and teams

License: MIT Python 3.8+

Clean up messy repositories with confidence. Remove backup files, fix naming conventions, and establish professional hygiene standards across your codebase.

🎯 Why repo-clean?

Every developer has encountered repositories cluttered with:

  • .backup, .bak, .old files scattered everywhere
  • Files named ENHANCED_, WORKING_, FIXED_, FINAL_
  • Inconsistent git configurations across team members
  • Missing or inadequate .gitignore patterns

repo-clean solves these problems safely and educationally.

✨ Features

πŸ” Complete Repository Health Toolkit

repo-clean is the only tool that combines file hygiene, bloat detection, AND comprehensive code quality linting in one unified interface.

πŸ” Smart Detection

  • File Hygiene: Backup files, naming conventions, git config issues
  • Bloat Detection: node_modules, build artifacts, oversized directories
  • Repository Structure: Nested repos, directories that should be separate projects
  • Large Files: Assets that should use Git LFS or external storage
  • Code Quality: Multi-ecosystem linting (Python, JavaScript, Go, Rust, Java)

πŸ§ͺ Comprehensive Code Quality Linting

  • 5 Ecosystems: Python, JavaScript/TypeScript, Go, Rust, Java
  • 15+ Linters: eslint, pylint, prettier, black, mypy, clippy, and more
  • Safe Auto-fixing: ONLY formatting fixes (prettier, black, gofmt) - NEVER logic changes
  • Custom Analysis: Complexity, security patterns, documentation quality

πŸ›‘οΈ Safety First

  • Preview mode: See exactly what will change before committing
  • Automatic backups: Creates rollback points before any changes
  • Incremental operations: Clean one issue type at a time
  • Detailed logging: Full audit trail of all operations

πŸ“š Educational

  • Explains why each issue matters
  • Suggests best practices for prevention
  • Provides learning resources for repository hygiene
  • Shows before/after metrics to demonstrate impact

πŸš€ Professional Grade

  • Handles large repositories efficiently
  • Supports multi-repository operations
  • Integrates with CI/CD workflows
  • Comprehensive error handling with helpful messages

πŸš€ Quick Start

# Install
pip install repo-clean

# Scan for issues (safe, read-only)
repo-clean scan

# Preview cleanup (shows what would change)
repo-clean clean --preview

# Clean backup files safely
repo-clean clean --backup-files

# Fix naming conventions
repo-clean rename --interactive

# Run comprehensive code quality linting
repo-clean lint

# Preview what could be safely fixed (recommended first)
repo-clean lint --preview-fixes

# Fix ONLY safe formatting issues (prettier, black, gofmt)
repo-clean lint --fix

# Full health check with recommendations
repo-clean report

πŸ“‹ Example Output

πŸ” Scanning repository for hygiene issues...

βœ… Repository: /home/user/my-project
πŸ“Š Found 23 issues across 4 categories:

πŸ—‚οΈ  Backup Files (15 found)
   β”œβ”€β”€ src/main.py.backup          [Why: Clutters workspace, confuses IDEs]
   β”œβ”€β”€ config.json.bak             [Why: Security risk if contains secrets]
   └── workflow.yml.old            [Why: Outdated code can mislead]

🏷️  Naming Issues (5 found)
   β”œβ”€β”€ ENHANCED_user_service.py    [Why: Non-descriptive, unprofessional]
   β”œβ”€β”€ WORKING_api_handler.py      [Why: Suggests experimental code]
   └── FIXED_database_utils.py     [Why: Temporary naming became permanent]

πŸ’Ύ Bloat Directories (3 found)
   β”œβ”€β”€ node_modules/ (847.2MB)     [Why: Should be in .gitignore, slows clones]
   β”œβ”€β”€ __pycache__/ (23.1MB)       [Why: Generated files, environment-specific]
   └── .pytest_cache/ (5.8MB)      [Why: Test artifacts, should be temporary]

πŸ“ Non-repo Directories (2 found)
   β”œβ”€β”€ legacy-project/             [Why: Nested .git found, should be submodule]
   └── data-warehouse/             [Why: 2.1GB directory, consider separate repo]

πŸ“Š Large Files (4 found)
   β”œβ”€β”€ assets/demo.mp4 (45.2MB)    [Why: Use Git LFS for media files]
   β”œβ”€β”€ data/export.zip (12.8MB)    [Why: Archives should use external storage]
   └── models/trained.pkl (156MB)  [Why: ML models should use Git LFS]

πŸ§ͺ Code Quality (3 ecosystems)
   β”œβ”€β”€ Python: pylint (23 issues - manual), black (8 issues - πŸ”§ fixable), mypy βœ…
   β”œβ”€β”€ JavaScript: eslint (15 issues - manual), prettier (12 issues - πŸ”§ fixable)
   └── Custom: complexity (3 - manual), security patterns βœ…

βš™οΈ  Git Config (2 issues)
   β”œβ”€β”€ user.name: "root"           [Why: Poor attribution, not descriptive]
   └── user.email: missing         [Why: Required for proper attribution]

πŸ“„ Gitignore (1 gap)
   └── Missing *.backup* pattern   [Why: Future backup files will be tracked]

πŸ’‘ Run 'repo-clean clean --preview' to see proposed fixes
πŸ§ͺ Run 'repo-clean lint --preview-fixes' to see safe formatting fixes available
πŸ”§ Run 'repo-clean lint --fix' for SAFE formatting only (never logic changes)
πŸ“š Run 'repo-clean explain backup-files' to learn more

πŸ“– Documentation

🀝 Contributing

Born from real-world experience cleaning 1,500+ problematic files across 42 production repositories.

We welcome contributions! See CONTRIBUTING.md for guidelines.

πŸ“„ License

MIT License - see LICENSE for details.


Built with ❀️ for the developer community

About

🧹 Professional repository cleanup utility - Remove backup files, fix naming conventions, and establish hygiene standards

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages