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

Use separate Pylint steps in CI for hepdata_lib and tests directories #267

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

GraemeWatt
Copy link
Member

@GraemeWatt GraemeWatt commented Jul 23, 2024

- name: Run pylint
if: ${{ always() && !startsWith(matrix.python-version, '3.6') && !startsWith(matrix.python-version, '3.7') }}
run: |
python -m pylint hepdata_lib/*.py
python -m pylint tests/*.py

I noticed in PR #265 that the CI is successful for commit 81adb42 (workflow run) despite the command python -m pylint hepdata_lib/*.py giving a exit code 8 with a message:

************* Module hepdata_lib
hepdata_lib/__init__.py:237:4: R0912: Too many branches (13/12) (too-many-branches)

-----------------------------------
Your code has been rated at 9.99/10

Thus it looks like only the second command python -m pylint tests/*.py giving Your code has been rated at 10.00/10 (exit code 0) determines whether the "Run pylint" step passes or fails. The subsequent commit 51f13c1 (workflow run) gives issues for both the hepdata_lib and tests directories and the "Run pylint" step fails. This PR therefore separates the single "Run pylint" step into separate steps for the hepdata_lib and tests directories so that a code rating less than 10.00/10 (corresponding to a non-zero exit code for pylint) for either directory will result in the CI failing.


📚 Documentation preview 📚: https://hepdata-lib--267.org.readthedocs.build/en/267/

@GraemeWatt GraemeWatt requested a review from clelange July 23, 2024 05:05
Copy link

codecov bot commented Jul 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.37%. Comparing base (ba9f2e2) to head (e0c9d26).
Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #267   +/-   ##
=======================================
  Coverage   90.37%   90.37%           
=======================================
  Files           5        5           
  Lines        1112     1112           
  Branches      251      251           
=======================================
  Hits         1005     1005           
  Misses         78       78           
  Partials       29       29           
Flag Coverage Δ
unittests-3.10 90.37% <ø> (ø)
unittests-3.11 90.37% <ø> (ø)
unittests-3.6 90.09% <ø> (ø)
unittests-3.7 90.09% <ø> (ø)
unittests-3.8 90.19% <ø> (ø)
unittests-3.9 90.19% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@clelange clelange left a comment

Choose a reason for hiding this comment

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

Thanks, good catch! I would have thought that the first failing command should have exited and have the workflow fail but apparently it doesn't...

@clelange clelange merged commit dcc23bd into main Jul 23, 2024
27 checks passed
@GraemeWatt GraemeWatt deleted the separate-pylint-steps branch July 23, 2024 12:48
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.

2 participants