Ruff Fixer is a Rust command-line tool designed to automatically identify and fix issues in Python code using the Ruff tool and OpenAI's ChatGPT API. This tool runs Ruff checks on a specified root folder, identifies issues in Python files, and then uses ChatGPT to provide fixes for those issues.
- Runs Ruff checks on a specified directory.
- Groups issues by file and sends each file's issues to OpenAI's ChatGPT API for fixes.
- Asynchronously applies the fixes to the affected files.
- Rust and Cargo installed (Install Rust).
- The
ruff
tool installed and available in your system's PATH (Ruff installation guide). - OpenAI API key for accessing the ChatGPT API.
-
Clone the repository:
git clone https://github.com/kukushechkin/ruff_fixer.git cd ruff_fixer
-
Build the project using Cargo:
cargo build --release
This will create an executable file in the
target/release
directory.
To run Ruff Fixer, use the following command:
cargo run -- <api_key> <ruff_path> <root_folder>