Style all (non-clang) code with clang-format
Does anyone see issues with the current .clang-format file?
I'll have a look. Appears that there's a plugin for AppCode that swaps the auto format of AppCode with clang-format.
If we use clang-format (and I don't see why not), add a passage in "working on C2" that we use it and if working on AppCode one can use the ClangFormatJ plugin.
What do you mean with adding a passage?
I meant using clang-format for the c2c code written in c++, not using it to style c2 code. For c2 I think we need to create a c2format or c2style tool.
A few bugs:
SmallVector <IdentifierInfo *, 32> Parameters => SmallVector < IdentifierInfo * , 32 > Parameters
IdentifierInfo* II and IdentifierInfo *II => IdentifierInfo * II
do {
foo();
} while (true);
Became
do {
foo();
}
while (true);
There might be more.
I mean add some text on the github wiki or in the docs about it.
By the way, is there a way to get wiki access? I was thinking of documenting the parser as I go along.
I tried to give access to a specific list of persons (like you), but couldn't find anything like that. It's only possible to give write access to 'Collaborators'. Those are people who also have write access to the git archive itself..
On Fri, Nov 9, 2018 at 3:33 AM Christoffer Lerno [email protected] wrote:
I mean add some text on the github wiki or in the docs about it.
By the way, is there a way to get wiki access? I was thinking of documenting the parser as I go along.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/c2lang/c2compiler/issues/63#issuecomment-437229354, or mute the thread https://github.com/notifications/unsubscribe-auth/AAC1mqqcv418jsr2HfIpC83TQf_30H2wks5utOl2gaJpZM4YUOPM .
Yea, you either need to open the wiki for everyone to edit, or add those people as collaborators, neither of which particularly fits the case.
Are collaborators the only ones that can be assigned to tasks as well? It's a bit weird not being able to get assigned to something you're working on.
@lerno Yeah, one can only assign the owner, collaborators or organization members afaik, on Github
@bvdberg I humbly pray for a different switch format. I find
switch (foo) {
case 1:
}
Inconsistent (the only construct that doesn't respect indent!) and near impossible to read (can't rely on indent to see where we are)
I know the idea is that case is a label (so it does not create a new scope – unlike C2!), but I really think there is a huge readability loss. The 4 characters you gain horizontally isn't enough to pay for it.
(I also indent labels, but labels are not common enough for it to become a problem for me, although I suggest C2 code style would be indenting labels as well. Consider defer where the labels inside the defer cannot be jumped to. It would be unsuitable to use them without indent.
Clang style is still 3 spaces? @bvdberg
I updated the clang-format file to 4 spaces instead of 3. That matches the current code better and I think 4 spaces is easier on the eyes...
NOTE: I haven't actually applied the clang format file yet..