Skip to content
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

Merged
merged 10 commits into from
Dec 4, 2018
Merged

Add git diff content on relint check #1

merged 10 commits into from
Dec 4, 2018

Conversation

anapaulagomes
Copy link
Collaborator

@anapaulagomes anapaulagomes commented Oct 26, 2018

Usage: git diff | relint my_file.py --diff

test_relint.py Outdated Show resolved Hide resolved
Copy link
Owner

@codingjoe codingjoe left a 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.

relint.py Outdated Show resolved Hide resolved
relint.py Outdated Show resolved Hide resolved
relint.py Outdated Show resolved Hide resolved
relint.py Outdated Show resolved Hide resolved
Copy link
Owner

@codingjoe codingjoe left a 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.

relint.py Outdated Show resolved Hide resolved
Co-Authored-By: anapaulagomes <apgomes88@gmail.com>
relint.py Outdated Show resolved Hide resolved
relint.py Outdated Show resolved Hide resolved
relint.py Outdated Show resolved Hide resolved
test_relint.py Outdated Show resolved Hide resolved
@codingjoe codingjoe removed their assignment Oct 29, 2018
Copy link
Owner

@codingjoe codingjoe left a 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 ;)

README.rst Outdated Show resolved Hide resolved
README.rst Outdated Show resolved Hide resolved
relint.py Outdated Show resolved Hide resolved
test_relint.py Outdated Show resolved Hide resolved
relint-pre-commit.sh Show resolved Hide resolved
@anapaulagomes
Copy link
Collaborator Author

Thank you for your valuable inputs, @codingjoe. 👍🏽

Copy link
Owner

@codingjoe codingjoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect, thanks @anapaulagomes

@codingjoe codingjoe merged commit 69e8a89 into codingjoe:master Dec 4, 2018
@codingjoe
Copy link
Owner

Released in 0.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants