1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vet: remove false positive space indent errors inside strings (#9568)

This commit is contained in:
Lukas Neubert
2021-04-03 12:16:49 +02:00
committed by GitHub
parent 7f81702d81
commit 094441c863
3 changed files with 21 additions and 7 deletions

View File

@ -1,3 +1,5 @@
cmd/tools/vvet/tests/indent_with_space.vv:2: error: Looks like you are using spaces for indentation.
cmd/tools/vvet/tests/indent_with_space.vv:10: error: Looks like you are using spaces for indentation.
cmd/tools/vvet/tests/indent_with_space.vv:16: error: Looks like you are using spaces for indentation.
cmd/tools/vvet/tests/indent_with_space.vv:19: error: Looks like you are using spaces for indentation.
NB: You can run `v fmt -w file.v` to fix these errors automatically

View File

@ -4,10 +4,17 @@ fn main() {
fn block_comments() {
/* tab to indent the comment
spaces before
also spaces before
same here */
/* spaces for comment indentation (ouch)
and inside too
*/
spaces before
also spaces before
same here */
/* spaces for comment indentation (ouch)
and inside too
*/
}
fn space_inside_strings() {
str := "Bad space usage for variable indentation.
Here it's fine.
Here too."
str2 := 'linebreak and space\n inside'
}