alx-tools / Betty

Holberton-style C code checker written in Perl
GNU General Public License v3.0
1.26k stars 1.77k forks source link

BETTY WARNING: "unnecessary whitespace before a quoted newline" #18

Open Hillmonkey opened 7 years ago

Hillmonkey commented 7 years ago

Not a huge issue, but the following line triggers a warning from betty: #define DELIM " \n\t" ... see the warning as quoted in the subject ... I do a workaround by placing the space character between the newline and tab chars like so: #define DELIM "\n \t"

yeungegs commented 7 years ago

Have you tried escaping the whitespace? `

Or, quoting the space itself?

Hillmonkey commented 7 years ago

White space?!? I've been trying to escape white space my whole life! Ha!

I'm thinking that escaping whitespace is more relevant in the context of bash scripting ... less so in a C program, unless I am building a string to pass into the shell.

I guess what I'm saying is that I think this Betty warning is legitimate in other contexts, but less so in the context of defining a macro.

ken00alx commented 2 years ago

white space has been painting my brain white and chunky leading to different warnings

Chimekinglsey commented 1 year ago

Please can anyone suggect on how i can remove this trailing whitespace error?

ken00alx commented 1 year ago

white space means for you to delete and space before or after your typed code

example :1 is the number line followed by space as white space and another

  1. with a tab for indentation
  2. printf("Chime Kingsely); this is wrong in betty style below used of a tab of 4 space indentation
  3. printf("Chime Kingsely);

On Thu, Oct 20, 2022 at 2:36 AM Chime Kingsley @.***> wrote:

Please can anyone suggect on how i can remove this trailing whitespace error?

— Reply to this email directly, view it on GitHub https://github.com/holbertonschool/Betty/issues/18#issuecomment-1284786908, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZYIH67X3BZSIBK4VYOYEX3WECOYFANCNFSM4DSI3UIQ . You are receiving this because you commented.Message ID: @.***>

ayoubelmohamedi commented 1 year ago

usually check line by line whether there is an extra whitespace in the beginning or end. You must know how many whitespace you have to handle since the compiler does tell in case you have a debugger for it. errors are often looks similar to this: ERROR: trailing whitespace total: 1 errors, 0 warnings, 23 lines checked

nyambuukim commented 1 year ago

root@ca08fbc1980a:~/alx-low_level_programming/0x01-variables_if_else_while# betty 2-print_alphabet.c

========== 2-print_alphabet.c ========== 2-print_alphabet.c:15: ERROR: trailing whitespace total: 1 errors, 0 warnings, 15 lines checked main

ayoubelmohamedi commented 1 year ago

@nyambuukim Trailing whitespace is any spaces or tabs after the last non-whitespace character on the line until the newline.

khlifaelbad commented 6 months ago

2-print_alphabet.c:15: ERROR: trailing whitespace total: 1 errors, 0 warnings, 15 lines checked => this issue inside main has checked with betty so u hve to followed betty docs instructions so here trailing whitespace means u have to remove space between lines or u do 2 spaces like while (..).