Whole file
terryyin/lizard
The author described this change as “Fix incorrect python function end line when function declared with multiple lines”. It counts as a record because the check below fails on the code as it stood at e6758034a and passes on a79aa8c95, with nothing else changed between the two runs.
Projectterryyin/lizard
Fix saved2022-03-16
Sharing licenceMIT · LICENSE.txt
Change size+3 −1
What the code was meant to do, written into the code itself as a save note
Fix incorrect python function end line when function declared with multiple lines
The change
| 53 | 53 | current_leading_spaces += count_spaces(token) | |
| 54 | 54 | else: | |
| 55 | 55 | if not token.startswith('#'): | |
| 56 | - | indents.set_nesting(current_leading_spaces, token) | |
| 56 | + | current_function = self.context.current_function | |
| 57 | + | if current_function.name == '*global*' or current_function.long_name.endswith(')'): | |
| 58 | + | indents.set_nesting(current_leading_spaces, token) | |
| 57 | 59 | reading_leading_space = False | |
| 58 | 60 | else: | |
| 59 | 61 | reading_leading_space = True |
The check that tells the two apart
fail→pass·test/test_languages/testPython.py::Test_parser_for_Python::test_multi_line_function_def_function_end
Check file test/test_languages/testPython.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before ite6758034a64589f13bdf11dac76f812bc3399518
Broken version dated2022-03-08
Modulelizard_languages.python
Units changedPythonReader
Fingerprint87d4d566f8dc9b9f
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in terryyin/lizard
- 2026-08-08fix(java): do not report control structures as methods
- 2026-07-02HalsteadClassifier
- 2026-07-02fix(csv): emit columns for extensions with multiple FUNCTION_INFO fields
- 2026-06-15fix(golike): register generic functions with [...] type params
- 2026-06-15fix(java): enhance parsing of generic and qualified type names in anonymous classes
- 2026-06-11fix(script): stop a '#' comment continuing past a trailing backslash (#317)