HEPData / hepdata_lib

Library for getting your data into HEPData
https://hepdata-lib.readthedocs.io
MIT License
16 stars 39 forks source link

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

Closed GraemeWatt closed 3 months ago

GraemeWatt commented 3 months ago

https://github.com/HEPData/hepdata_lib/blob/ba9f2e28e33e59bb2bf5b429cab97d31cd556538/.github/workflows/tests.yml#L144-L148

I noticed in PR #265 that the CI is successful for commit 81adb429876820762c6b8608b9f36cc69d1040e9 (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 51f13c107270af2c7c3ba6aec561f9701683ce06 (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/

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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](https://app.codecov.io/gh/HEPData/hepdata_lib/pull/267/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HEPData) | Coverage Δ | | |---|---|---| | [unittests-3.10](https://app.codecov.io/gh/HEPData/hepdata_lib/pull/267/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HEPData) | `90.37% <ø> (ø)` | | | [unittests-3.11](https://app.codecov.io/gh/HEPData/hepdata_lib/pull/267/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HEPData) | `90.37% <ø> (ø)` | | | [unittests-3.6](https://app.codecov.io/gh/HEPData/hepdata_lib/pull/267/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HEPData) | `90.09% <ø> (ø)` | | | [unittests-3.7](https://app.codecov.io/gh/HEPData/hepdata_lib/pull/267/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HEPData) | `90.09% <ø> (ø)` | | | [unittests-3.8](https://app.codecov.io/gh/HEPData/hepdata_lib/pull/267/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HEPData) | `90.19% <ø> (ø)` | | | [unittests-3.9](https://app.codecov.io/gh/HEPData/hepdata_lib/pull/267/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HEPData) | `90.19% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HEPData#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.