pylint icon indicating copy to clipboard operation
pylint copied to clipboard

Fix 'function never returning' computation

Open antoniogamizdelgado opened this issue 1 year ago β€’ 2 comments

This fixes 2 bugs in the computation:

Never is handled in addition to NoReturn. Give priority to the explicit --never-returning-functions option.

This PR was copied from https://github.com/pylint-dev/pylint/pull/9535 (I cannot add commits there and we really need this).

Type of Changes

Type
βœ“ :bug: Bug fix

Description

Closes https://github.com/pylint-dev/pylint/issues/7565

antoniogamizdelgado avatar May 02 '24 18:05 antoniogamizdelgado

πŸ€– According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

This comment was generated for commit eb30f7c48c4fed1245899a502e16f0365dc8afa1

github-actions[bot] avatar May 03 '24 03:05 github-actions[bot]

@antoniogamizbadger Would you like to continue working on this?

DanielNoord avatar Jun 03 '24 20:06 DanielNoord

πŸ€– According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

This comment was generated for commit 5216ea997c5d85b7ab356878386e89faf7f0c3da

github-actions[bot] avatar Jul 15 '24 15:07 github-actions[bot]

πŸ€– According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

This comment was generated for commit fe4c3d327c6a0edf1f014c2be1b19325f3223dc3

github-actions[bot] avatar Jul 15 '24 15:07 github-actions[bot]

πŸ€– According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

This comment was generated for commit 27ba1f8af36674489de1d9a5a8451b3c2f982d13

github-actions[bot] avatar Jul 15 '24 17:07 github-actions[bot]

@antoniogamizbadger Thanks for the contribution!

jacobtylerwalls avatar Jul 15 '24 18:07 jacobtylerwalls

(Shouldn't there be a Never used somewhere ?)

This is covered by the call to assert_never(), which is annotated to return Never. Reverting that part of the patch causes a test failure, so it's covered.

jacobtylerwalls avatar Jul 15 '24 18:07 jacobtylerwalls

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.

Project coverage is 95.78%. Comparing base (d9ea2f7) to head (95b6e8b). Report is 123 commits behind head on main.

Files with missing lines Patch % Lines
pylint/checkers/refactoring/refactoring_checker.py 71.42% 2 Missing :warning:
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #9591      +/-   ##
==========================================
- Coverage   95.80%   95.78%   -0.02%     
==========================================
  Files         174      174              
  Lines       18885    18880       -5     
==========================================
- Hits        18092    18085       -7     
- Misses        793      795       +2     
Files with missing lines Coverage Ξ”
pylint/checkers/variables.py 97.23% <ΓΈ> (ΓΈ)
pylint/checkers/refactoring/refactoring_checker.py 98.16% <71.42%> (-0.22%) :arrow_down:

codecov[bot] avatar Jul 15 '24 18:07 codecov[bot]

Coverage decrease is from moving existing uncovered lines around.

jacobtylerwalls avatar Jul 15 '24 18:07 jacobtylerwalls

πŸ€– According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

This comment was generated for commit 95b6e8bf052347eb56cc7a5cfde0951d6aa40bd0

github-actions[bot] avatar Jul 15 '24 18:07 github-actions[bot]