-
-
Notifications
You must be signed in to change notification settings - Fork 444
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
Fix handling of multi-line function declarations #1705
Merged
Merged
+127
−1
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks, this looks promising. I will take a look soon. |
fe23ff4
to
5a4073e
Compare
I'm going to merge this. I've thanked Jan Rusak in the changelog and contributors file. I'll gladly add other names, but I'm not sure what they are! :) |
Thanks - we did it together: Jan Rusak, Maciej Kowalczyk and Joanna Ejzel. |
nedbat
added a commit
that referenced
this pull request
Dec 4, 2023
Thanks again, I added the names in 470e086 |
This is now released as part of coverage 7.3.3. |
renovate bot
referenced
this pull request
in allenporter/flux-local
Dec 16, 2023
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [coverage](https://togithub.com/nedbat/coveragepy) | `==7.3.2` -> `==7.3.3` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>nedbat/coveragepy (coverage)</summary> ### [`v7.3.3`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-733--2023-12-14) [Compare Source](https://togithub.com/nedbat/coveragepy/compare/7.3.2...7.3.3) - Fix: function definitions with multi-line signatures can now be excluded by matching any of the lines, closing `issue 684`*. Thanks, `Jan Rusak, Maciej Kowalczyk and Joanna Ejzel <pull 1705_>`*. - Fix: XML reports could fail with a TypeError if files had numeric components that were duplicates except for leading zeroes, like `file1.py` and `file001.py`. Fixes `issue 1709`\_. - The `coverage annotate` command used to announce that it would be removed in a future version. Enough people got in touch to say that they use it, so it will stay. Don't expect it to keep up with other new features though. - Added new :ref:`debug options <cmd_run_debug>`: - `pytest` writes the pytest test name into the debug output. - `dataop2` writes the full data being added to CoverageData objects. .. \_issue 684:[https://github.com/nedbat/coveragepy/issues/684](https://togithub.com/nedbat/coveragepy/issues/684)4 .. \_pull 1705[https://github.com/nedbat/coveragepy/pull/1705](https://togithub.com/nedbat/coveragepy/pull/1705)05 .. \_issue 170[https://github.com/nedbat/coveragepy/issues/1709](https://togithub.com/nedbat/coveragepy/issues/1709)709 .. \_changes\_7-3-2: </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/allenporter/flux-local). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy45My4xIiwidXBkYXRlZEluVmVyIjoiMzcuOTMuMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #684
The cause of this problem is the method of checking whether a particular clause should be excluded. In a file
parser.py
in function_raw_parse
(line 161) only the line that ends with:
is checked for excluded expressions, not all the lines in a statement that ends with a colon. The solution is to add checking if at least one line in the multi-line statement ended with:
has to be excluded and if that is the case - to exclude that clause. Multi-line statements are added after a token\n
, so after checking for excluded clauses in one-line statements. Because of that, checking if a clause after multi-line statement should be excluded was added starting from the line 193.Tests with different use cases were added.