Linter: no-else-return failing to detect return in this case
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
Research direction
Start at the linter implementation for the no-else-return rule and reproduce the warning with the provided nested if/else snippet. Done means the rule no longer reports the final else as unnecessary when the preceding branch can continue, with regression coverage for this case.
Written by the indexing model from the issue text.
Description
There is a bug in your linter that causes it to not recognize that the designated block can fail the if statement and skip the return statement:
-
The incorrect warning is:
“WARNING on line 75 (no-else-return)
Unnecessary 'else' after 'if'/'elif' blocks that end with 'return'” -
The code that triggered this error is:
...
#Return false if vector_angle falls between start_arc and end_arc.
#This will ensure that weapons can only fire within their designated arcs.
if end_arc > start_arc:
if vector_angle > end_arc or vector_angle < start_arc:
return false
else:
if vector_angle > end_arc and vector_angle < start_arc:
return false#Ensure target is within range
if vector_to_target.length() > ability_range:
return false
else:
return true
- Dominant language
- Rust
- Stars
- 458
- Forks
- 40
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GDQuest/GDScript-formatter
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
GDQuest/GDScript-formatter#362 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
GDQuest/GDScript-formatter#359 · 9 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
GDQuest/GDScript-formatter#327 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
GDQuest/GDScript-formatter#361 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 58/100
GDQuest/GDScript-formatter#360 ·
All issues in GDQuest/GDScript-formatter
Similar issues
-
bug github_actions
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
registrystack/registry-stack#1393 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
longbridge/gpui-kit#3223 ·
-
bug engine
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
rocky-data/rocky#2181 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
oasisprotocol/oasis-sdk#2523 ·
-
[indexer] [QA] Add a focused test for the new NonRetryableError / assertSocketAlive() behavior. Openbot:ai-assisted component:indexer QA-roadmap status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
midnightntwrk/midnight-indexer#1557 ·