Bad indentation
MathieuSoysal opened this issue · comments
Mathieu Soysal commented
Introduction
When we execute norminette with this file:
int main(void)
{
char *output;
output = malloc(sizeof(int) * 8);
for (int i = 0; i < 20; ++i)
{
sprintf(output, "%d", i);
sprintf(output, "%s",
is_fizz(i) ? (is_fizzbuzz(i) ? "FizzBuzz" : "Fizz") : (is_buzz(i) ? "Buzz" : output));
printf("%s\n", output);
}
free(output);
return (0);
}
It doesn't warn about the indentation.
Problem
When we use the formatter a new tab is added:
int main(void)
{
char *output;
output = malloc(sizeof(int) * 8);
for (int i = 0; i < 20; ++i)
{
sprintf(output, "%d", i);
sprintf(output, "%s",
is_fizz(i) ? (is_fizzbuzz(i) ? "FizzBuzz" : "Fizz") : (is_buzz(i) ? "Buzz" : output));
printf("%s\n", output);
}
free(output);
return (0);
}
And now the norminette warm about the indentation on this line:
is_fizz(i) ? (is_fizzbuzz(i) ? "FizzBuzz" : "Fizz") : (is_buzz(i) ? "Buzz" : output));
Younes Aassila commented
@cacharle This is related to the same bug I have already fixed in my PRs a month ago. Update still isn't on PyPI a month later. Any ETA?
keyhr commented
I've just applied updates to the PyPI packages.
Younes Aassila commented
@keyhr Thank you!
Younes Aassila commented
This issue should be closed since the fix has been published and no one reported encountering this issue afterwards.