-
Notifications
You must be signed in to change notification settings - Fork 334
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
Add clang formatting script and format all sample and src files #1095
base: develop-pre-3.4.1
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1095 +/- ##
===========================================
+ Coverage 16.34% 16.39% +0.05%
===========================================
Files 51 51
Lines 6846 6849 +3
===========================================
+ Hits 1119 1123 +4
+ Misses 5727 5726 -1 ☔ View full report in Codecov by Sentry. |
efc9126
to
9ad8a59
Compare
9ad8a59
to
f8516d4
Compare
gchar* stream_name; | ||
gchar* user_agent; | ||
guint retention_period_hours; | ||
gchar* kms_key_id; | ||
STREAMING_TYPE streaming_type; |
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.
Is there a way to keep it how it was before, I think the before version here is clearer. We should stick to one way and be consistent, the consistency is most important.
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.
In Producer C, we do use this same style of not having spaces added to align variable names - there are spaces for "#define"s though. I tested and searched around to find that the way clang-format works is it parses all the code and then puts it back together according to the configured format, so there is no way to remove this formatting. There may be a formatting rule that would add this spacing between variable type and name, but it would then apply to all variables. The two solutions I see are to either use another formatter, or place the following around code we do not want to format:
// clang-format off
...
// clang-format on
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.
If we introduce the files for formatting, and add a build in the CI but don't update our codebase to reflect the format, the check in the CI will fail. Is there any specific reason you removed the formatting from all the files you had added previously?
@niyatim23 I was testing whether it would affect the failing address sanitizer CI job. Just reverted those commits. |
Added the CLANG formatting guidelines used in Producer C SDK, formatted all files in the sample and src directories.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.