Skip to content

HansPeterRadtke/capov

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CapOv β€” Captain Obvious

Fixes the dumbest, most obvious Python code errors automatically.

CapOv corrects only the 100% safe stuff: missing imports, duplicate imports, unclosed brackets, and more β€” with zero assumptions.


πŸ”§ Installation

pip install capov

πŸš€ Example usage

from capov.fixers import process

code = '''
import os
import os
x = [1, 2, 3,
print(json.dumps(x)
'''

fixed = process(code)
print(fixed)

Command-line:

python -m capov your_script.py [options]

Options:

  • --in-place β†’ Overwrite the input file
  • --output FILENAME β†’ Write fixed code to a separate file
  • --backup β†’ Create a .bak backup before overwrite
  • --verbose β†’ Print debug messages
  • --log FILE β†’ Log to specified log file

πŸ§ͺ Run tests

To verify installation and test functionality:

python3 -m capov.tests

πŸ—‚ Project structure

  • capov/ β€” main package
    • fixers.py β€” bug fixing logic
    • main.py β€” CLI entry point
    • example.py β€” example usage
    • tests/
      • test_cli_full.py β€” full run tests
      • test_cli_params.py β€” CLI parameter tests
      • test_module_usage.py β€” module usage tests
      • faulty_scripts/ β€” broken Python samples

CapOv is your cleanup butler. Let him sweep the dumb bugs so you don't have to.

Submit bugs or contribute: https://github.com/HansPeterRadtke/capov

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published