-
Notifications
You must be signed in to change notification settings - Fork 57
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
Adding pre-commit #628
Adding pre-commit #628
Conversation
@stavros11 this is failing with a tsp+tensorflow issue, which looks familiar to me, do you remember if this is related to seeds? |
Thanks for implementing this.
|
@andrea-pasquale thanks for the comments.
yes, but if you try here, you will see that qibo fails, due to circular import, so I think we can do that in another PR.
yes, I fully agree.
yes, absolutely. |
Thanks for implementing this. I checked locally and it works for me.
I also agree with this. I think option (2) is more friendly for external developers, but we may get many additional commits if people push frequently (not sure if this is an issue).
I agree, we should add a related section in "How to contribute". We could also add the pre-commit libarary in setup.py as a requirement for the [tests] package, which is oriented towards developers.
Yes, I was aware of this from other branches and I can get reproduce it locally. An easy fix is to set |
I've fixed the documentation and I've also added the pre-commit action. |
Thanks, I have granted permission, please try again now. |
Now the action is there. I believe that it was failing because there were some conflicts. |
Sure, please go ahead, and indeed conflicts should not fail. |
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.
Thank you for all the updates and tests @andrea-pasquale. I think this can be merged.
@@ -45,6 +45,7 @@ The current code standards that are applied to any new changes: | |||
- **Tests**: We use pytest to run our tests that must continue to pass when new changes are integrated in the code. Regression tests, which are run by the continuous integration workflow are stored in ``qibo/tests``. These tests contain several examples about how to use Qibo. | |||
- **Coverage**: Test coverage should be maintained / be at least at the same level when new features are implemented. | |||
- **Pylint**: Test code for anomalies, such as bad coding practices, missing documentation, unused variables. | |||
- **Pre commit**: We use pre-commit to enforce automatation and to format the code. |
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.
Do you mean
- **Pre commit**: We use pre-commit to enforce automatation and to format the code. | |
- **Pre commit**: We use pre-commit to enforce automation and to format the code. |
?
Perhaps we could also say that this is enforced automatically for all PRs.
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.
Thanks for catching this.
Yes that's what I meant :)
Now that we've enabled the pre-commit action I should probably update this line.
@stavros11 please let me know when you are happy with the atol increase so we can merge this. |
Add atol in TSP test
Codecov Report
@@ Coverage Diff @@
## master #628 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 80 80
Lines 10342 10380 +38
=========================================
+ Hits 10342 10380 +38
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Adding a basic pre-commit hook and applying black to all files.