Epitech / coding-style-checker

22 stars 45 forks source link

[ERROR] False L1, L2, L3 positive with backslash in string #18

Closed ManiGillier closed 2 months ago

ManiGillier commented 2 months ago

Prerequisites

Error's description

The following code is detected as a false positive :

"\e[48;5;%dm \e[0m"

In itself, it is an error of compilation, but put in a good form (examples below), it is detected as errors of coding-style

First example

static const char *str = "\e[48;5;%dm \e[0m";

Errors : L2, L3

Second example

/*
** EPITECH PROJECT, 2024
** test
** File description:
** test
*/

#include <stdio.h>

int main(void)
{
    const int color = 250;

    dprintf(2, "\e[48;5;%dm \e[0m", color);
}

Errors: L1, L3 (not L2 for some reason)

I think the problem is due to the backslash (\) in the string that breaks the checker and comes out of the string.

Hopefully you have everything needed to reproduce the issue ! If you need anything more to reproduce the error, I will answer in the chat of this issue.

Thank you very much.

Sigmanificient commented 2 months ago

Hi, thank you for reporting a bug to the coding style. However, it seems that you opened your issue within the wrong repository.

You might want to open your issue on the banana-coding-style-checker which contains the actual ruleset implementation for the coding style. This repository own only the script that are responsible to run the ruleset.

Thanks for your time

ManiGillier commented 2 months ago

Oh right thank you i'm gonna correct that mistake !

Sigmanificient commented 2 months ago

Will wait to see your issue on the other repo