Professional repository cleanup utility with safety-first operations
Project description
๐งน repo-clean
Professional repository cleanup utility for developers and teams
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,.oldfiles scattered everywhere- Files named
ENHANCED_,WORKING_,FIXED_,FINAL_ - Inconsistent git configurations across team members
- Missing or inadequate
.gitignorepatterns
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
- GitIgnore Management: Intelligent .gitignore generation and gap analysis
- 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
# Analyze .gitignore coverage
repo-clean gitignore --analyze
# Generate or update .gitignore intelligently
repo-clean gitignore --generate
# 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
- Installation Guide
- Usage Examples
- Code Quality Linting
- GitIgnore Management
- Safety Features
- Error Handling
- Best Practices
- GitHub Integration
๐ค 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file repo_clean-1.0.0.tar.gz.
File metadata
- Download URL: repo_clean-1.0.0.tar.gz
- Upload date:
- Size: 73.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ff01fd55d9c2ac40b8a17569c90d52e2839e6be230cfdb6b25b4af632282836
|
|
| MD5 |
763f0882c18f40795f86179135354026
|
|
| BLAKE2b-256 |
d4150ecfd51dc70dbf85b1ae85de25307426a2bcea2cf6e7f31079b8f2c9e9fc
|
File details
Details for the file repo_clean-1.0.0-py3-none-any.whl.
File metadata
- Download URL: repo_clean-1.0.0-py3-none-any.whl
- Upload date:
- Size: 47.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ccdcd141f84e92bcc4e3d452992f6efca94e23c365c3945f99f59e46c2d4fa9
|
|
| MD5 |
d34e5eafd775a97c3eaf965b4b152b89
|
|
| BLAKE2b-256 |
807ac95d5fe7c771446a7efbda477d20e26517c5444f69bd388810f6e82ce801
|