-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/code formatting #1912
Feat/code formatting #1912
Conversation
https://gist.github.com/kateinoigakukun/b0bc920e587851bfffa98b9e279175f2 I think it needs to be added after this goes in as a separate PR (maybe add the previous cleanup commit too). |
ad7da91
to
b1b7e84
Compare
What do you think of these formatting settings for c++ files? |
b1b7e84
to
845d7e7
Compare
const char* get##name (unsigned i); \ | ||
void add##name (const char* s); \ | ||
unsigned get##name##Count (); \ | ||
#define DEF_VECTOR(klass, type, name) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really sure these are an improvement tbh, but willing to live with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean? Do you think the formatting should not add line breaks to these macro's?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just saying I find the old style more readable in this case, but not a big deal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, I see. I can try to change it
8057f58
to
a6fc5f1
Compare
a6fc5f1
to
891bd95
Compare
- Added `RunClangFormat` shell script - Added workflow to check if formatting was applied to PR's
3aa766c
to
61f9c1b
Compare
61f9c1b
to
a5ff7c6
Compare
@tritao This is ready for review. I was unable to resolve the macro thing specifically, there's no option for that. There is however an option to force small functions onto one line so it does look as before, but that means ALL small functions will ALWAYS be forced on one line. There's no option to leave it unfortunately. I can enable that one if that's your preference. Lastly, I haven't formatted/added C# files to the workflow checks yet. Clang-format does support C# now, so I can add that as well. Let me know if you think it should be part of this PR |
Thanks, bit busy today, I will try to look at this ASAP and merge/provide some feedback. |
Was hoping that would have removed the extra indentation in namespaces, for example https://github.com/duckdoom5/CppSharp/blob/feat/code-formatting/src/CppParser/AST.cpp#L65. I think I would also prefer to have Anyway in the name progress lets get this in, we can re-format easily if needed in the future. Thanks for your work on this. |
Added formatting settings for c++/c# files
Added a workflow to check formatting of c++ files
Generated files are ignored
C++/CLI isn't properly supported by clang-format so those are ignored as well