42School / norminette

Official 42 norminette
MIT License
974 stars 141 forks source link

Space after Break and Continue #171

Closed psudo-dev closed 3 years ago

psudo-dev commented 3 years ago

https://github.com/42School/norminette/blob/a16b54923b3c459371342354eafc727a5eb70614/norminette/rules/check_expression_statement.py#L52-L53

if (i > 0)
    break ;

Is there a reason why break and continue need a space after it?

I can understand why return demands a space since you always have to return something, even if it's a (0). But on break and continue it's just odd to have a space and then a semicolon.

I tried to find an explanation but I couldn't find it. Couldn't break and continue be an exception?

N0ich commented 3 years ago

Hello,

The only reason is the one you mentionned, they are simply not an exception and fall under the "keyword" category. I'll take it up to see if we want to change it.

Thanks for the ticket