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 pre-commit hook to run pylint on tests passing pylint #3621

Merged
merged 4 commits into from
Jan 11, 2023

Conversation

timmysilv
Copy link
Contributor

Context:
pre-commit helps catch failures before they happen on CI. CI will fail if an already-whitelisted test isn't passing pylint.

Description of the Change:
Run pylint on whitelisted tests.

Benefits:
Less CI failures, faster development process.

Possible Drawbacks:

  • I had to write it using a bash entrypoint because the pylint entrypoint doesn't support custom file lists evaluated in a sub-shell like I have done here.
  • Users might not expect to see this new pre-commit hook (imo this is no biggie - if you installed the pre-commit hook yourself, you can probably figure out this mystery!)

@github-actions
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@timmysilv timmysilv requested review from albi3ro and apotapov January 10, 2023 22:58
@codecov
Copy link

codecov bot commented Jan 10, 2023

Codecov Report

Merging #3621 (5fef0e6) into master (efe3c07) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #3621      +/-   ##
==========================================
- Coverage   99.86%   99.86%   -0.01%     
==========================================
  Files         313      313              
  Lines       28097    28095       -2     
==========================================
- Hits        28060    28058       -2     
  Misses         37       37              
Impacted Files Coverage Δ
pennylane/math/is_independent.py 100.00% <100.00%> (ø)
pennylane/qchem/hartree_fock.py 100.00% <100.00%> (ø)
pennylane/templates/layers/random.py 100.00% <100.00%> (ø)
pennylane/wires.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link

@apotapov apotapov left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Contributor

@albi3ro albi3ro left a comment

Choose a reason for hiding this comment

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

👍

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@timmysilv timmysilv enabled auto-merge (squash) January 11, 2023 16:36
@timmysilv timmysilv merged commit 607158d into master Jan 11, 2023
@timmysilv timmysilv deleted the pylint-test-pre-commit-hook branch January 11, 2023 16:59
apotapov pushed a commit that referenced this pull request Jan 11, 2023
* add pre-commit hook to run pylint on tests passing pylint

* skip test pre-commit if no tests are changed
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.

None yet

3 participants