42School / norminette

Official 42 norminette
MIT License
956 stars 140 forks source link

Inconsistent detection when using the cast operator inside a block #475

Open chlimous opened 9 months ago

chlimous commented 9 months ago

Describe the bug Norminette is not consistent with the cast operator. Warnings show up when it's used inside a block.

Erroneous code

while (i)
{
    while (j != (size_t)-1)
    {
    }
}

leads to: Error: SPC_AFTER_OPERATOR (line: 26, col: 29): missing space after operator Error: SPC_BFR_OPERATOR (line: 26, col: 29): missing space before operator

While:

while (j != (size_t)-1)
{
}

doesn't trigger warnings. This is the expected behavior.

Additional infos