T019: added else if detection
Issue #29
resolved
My previous correction (issue #28) was too simple. This new version is able to manage else token with or without followed by the if statement. The use cases are:
if (i == 1) {
printf("good");
} else
printf("bad");
if (i == 1) {
printf("good");
} else {
printf("good");
}
if (i == 1) {
printf("good");
} else if (i == 2) {
printf("good");
}
if (i == 1) {
printf("good");
} else if (i == 2)
printf("bad");
Comments (5)
-
-
Account Deleted Ok, first time I'm trying a pull request, I hope I've done it right.
-
Issue
#28was marked as a duplicate of this issue. -
I'm not sure how to use pull requests either... it doesn't seem as well made on bitbucket as it is on github. Anyway, I've fixed the test RuleT019 and pushed your commit in the main repository.
Thanks!
-
- changed status to resolved
fixed in adc368a
- Log in to comment
Thanks a lot for the fix! Could you submit a pull request with that fix as well as an updated test for this rule? It would also be nice to have your name (or nickname) so we can give you the credits for your contribution :-)