A simple yet effective Python script that helps you clean up your Python and JavaScript code by automatically finding and removing debugger statements.
- Searches for debugger statements in
.pyand.jsfiles - Prints the path and line number where the debugger was found
- Automatically removes the debugger statements
- Runs in the current directory without requiring user input
-
Clone this repository or download the
remove_debuggers.pyscript. -
Create an alias for the script to easily run it from any directory. Depending on your operating system, follow the instructions below:
Set-Alias -Name remove-debuggers -Value "path\to\remove_debuggers.py"
echo 'alias remove-debuggers="python /path/to/remove_debuggers.py"' >> ~/.bashrc source ~/.bashrc
-
Navigate to the directory containing your Python and JavaScript files in the terminal or command prompt.
-
Run the script with the following command:
remove-debuggersThe script will automatically search for and remove debugger statements in the current directory and its subdirectories.
π Supported Debugger Statements Currently, the script supports the following debugger statements:
import pdb; pdb.set_trace() import ipdb; ipdb.set_trace() debugger
π License This project is released under the MIT License.
π€ Contributing If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request. Your contributions are always welcome! π