Betty icon indicating copy to clipboard operation
Betty copied to clipboard

BETTY WARNING: "unnecessary whitespace before a quoted newline"

Open Hillmonkey opened this issue 7 years ago • 9 comments

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"

Hillmonkey avatar Jul 09 '17 23:07 Hillmonkey

Have you tried escaping the whitespace? `

Or, quoting the space itself?

yeungegs avatar Jul 17 '17 06:07 yeungegs

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.

Hillmonkey avatar Jul 17 '17 18:07 Hillmonkey

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

ken00alx avatar Jul 14 '22 14:07 ken00alx

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

Chimekinglsey avatar Oct 20 '22 01:10 Chimekinglsey

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: @.***>

ken00alx avatar Oct 20 '22 05:10 ken00alx

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

ayoubelmohamedi avatar Jun 21 '23 00:06 ayoubelmohamedi

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

nyambuukim avatar Aug 13 '23 01:08 nyambuukim

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

ayoubelmohamedi avatar Aug 13 '23 12:08 ayoubelmohamedi

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 (..).

khlifaelbad avatar Feb 21 '24 12:02 khlifaelbad