-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add git diff content on relint check #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really good work @anapaulagomes thanks!
I left you a couple small comments and suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend to take a look at pycodestyles implementation.
https://github.com/PyCQA/pycodestyle/blob/77ad77278d04db396fcaddbc174b75bf3933a153/pycodestyle.py#L1739-L1765
I would also suggest to parse the diff from stdin
and not call a subprocess. This allows people to send any kind of diff to relint. This limits the use case to a pre commit hook.
Co-Authored-By: anapaulagomes <apgomes88@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case you missed it during our 1on1 review: I believe you outdid yourself here. This is really amazing work. You perfectly nailed every single bit. It easily understandable code while not wasting an ounce of memory. 🥇
Are you sure you want to raise the bar that high ;)
Thank you for your valuable inputs, @codingjoe. 👍🏽 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perfect, thanks @anapaulagomes
Released in 0.4.0 |
Usage:
git diff | relint my_file.py --diff