GrieferAtWork / tpp

Tiny PreProcessor
Other
17 stars 1 forks source link

code format issue tab or spaces #6

Closed asmwarrior closed 7 months ago

asmwarrior commented 7 months ago

Hi, I see that there are spaces and tabs in the source code, see the 2 image-shots below: (the source code was shown in the Code::Blocks IDE)

image

and

image

My question is: could it be possible to use all the spaces without any tabs? It looks quite strange that a tab char at the beginning, and a lot of spaces follows later.

Thanks.

GrieferAtWork commented 7 months ago

The formating you're seeing is intended and the result of the .clang-format config option "UseTab: ForIndentation":

https://github.com/GrieferAtWork/tpp/blob/800e2176b8f33fe67d14a6a1ddb89c4c284890cf/.clang-format#L130

The idea here is to:

My question is: could it be possible to use all the spaces without any tabs? It looks quite strange that a tab char at the beginning, and a lot of spaces follows later.

Sure: do whatever you want with tpp, as long as its allowed by the license. Other than that, it's not like I could stop you if I wanted to.

But don't expect me to accept pull requests if you're using completely different formating rules (if that's your goal here). Also: the formatting defined by .clang-format isn't exactly what you see in code, so just re-formating will just result in broken output (some day, I'll write my own C code formatter that automatically produces output just the way I like, but until then I usually do most of the formating by hand, and use clang-format as a tool for doing so more quickly).

asmwarrior commented 7 months ago

The idea here is to:

* use tabs for indentation

* use space for padding

OK, I see, thanks for the explanation.