Skip to main content

Professional repository cleanup utility with safety-first operations

Project description

๐Ÿงน 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
  • 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

๐Ÿค 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repo_clean-1.0.0.tar.gz (73.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

repo_clean-1.0.0-py3-none-any.whl (47.9 kB view details)

Uploaded Python 3

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

Hashes for repo_clean-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0ff01fd55d9c2ac40b8a17569c90d52e2839e6be230cfdb6b25b4af632282836
MD5 763f0882c18f40795f86179135354026
BLAKE2b-256 d4150ecfd51dc70dbf85b1ae85de25307426a2bcea2cf6e7f31079b8f2c9e9fc

See more details on using hashes here.

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

Hashes for repo_clean-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1ccdcd141f84e92bcc4e3d452992f6efca94e23c365c3945f99f59e46c2d4fa9
MD5 d34e5eafd775a97c3eaf965b4b152b89
BLAKE2b-256 807ac95d5fe7c771446a7efbda477d20e26517c5444f69bd388810f6e82ce801

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page