https://github.com/eyalk11/gpt-linter
Python minor issue resolver (mypy) using gpt!
https://github.com/eyalk11/gpt-linter
asistant chatgpt coding gpt guidance llm mypy python
Last synced: 8 months ago
JSON representation
Python minor issue resolver (mypy) using gpt!
- Host: GitHub
- URL: https://github.com/eyalk11/gpt-linter
- Owner: eyalk11
- License: agpl-3.0
- Created: 2023-07-21T02:58:53.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-12-12T14:29:31.000Z (over 1 year ago)
- Last Synced: 2025-09-23T06:14:41.225Z (9 months ago)
- Topics: asistant, chatgpt, coding, gpt, guidance, llm, mypy, python
- Language: Python
- Homepage:
- Size: 389 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GPT-Linter
Solve linter errors using [guidance](https://github.com/microsoft/guidance) and gpt API.
It runs mypy on targeted file and then uses gpt to try to fix the issues (espcially good for minor nagging issues).
Displays a diff file for the required changes and ask you if you want to apply.
# Demo
https://www.youtube.com/watch?v=dgRa33epPQg
# Installation
```
pip install gpt-linter
```
it is generally better to install the master
```
pip install git+https://github.com/eyalk11/gpt-linter.git
```
You will need openai access token for it.
In powershell:
```
$env:OPEN_AI_KEY = "sk-XXX"
```
Or
```
OPEN_AI_KEY=sk-XXX python -m gpt_linter ...
```
Of course, mypy is required too.
# Usage
See
```
python -m gpt_linter --help
```
A typical usage is
```
python -m gpt_linter --proj-path [PROJECT] [PYFILE]
```
It then tries to get a list of fixes from the chat , prints them , and finally try to come up with an updated version of the solution.
It then checks the final file again , showing you the errors after the change, and displayes a diff file. It asks you if you want to apply the changes,
and reruns main if not all issues were resolved.
If you want it to generate diff file, use:
```
python -m gpt_linter --proj-path [PROJECT] --no-color --dont-ask [PYFILE] > myfile.diff
```
For example:
