-
Notifications
You must be signed in to change notification settings - Fork 96
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
apply updated code style #1196
base: master
Are you sure you want to change the base?
apply updated code style #1196
Conversation
.git-blame-ignore-revs
Outdated
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.
after squash, there will be another sha commit. .git-blame-ignore-revs
should be added after the merge of this MR
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.
Yes, it's added here so you can test it and make sure that git blame continues working
@@ -3,12 +3,12 @@ | |||
#include "common/smart_ptrs/intrusive_ptr.h" | |||
|
|||
#ifndef INCLUDED_FROM_KPHP_CORE | |||
#error "this file must be included only from runtime-core.h" | |||
#error "this file must be included only from runtime-core.h" |
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.
don't want to enable `IndentPPDirectives'?
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.
+1 for macro indentation
AllowAllParametersOfDeclarationOnNextLine: true | ||
AllowShortBlocksOnASingleLine: false | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: Empty |
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.
maybe we should keep it?
ReflowComments: true | ||
SortIncludes: true | ||
SpaceAfterCStyleCast: false | ||
SpaceAfterTemplateKeyword: false |
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'd keep it. IMHO
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.
Includes are sorted implicitly by setting base variant on LLVM, I suppose.
IncludeCategories: | ||
- Regex: '^<' | ||
Priority: 1 | ||
IndentCaseLabels: true |
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.
maybe we should keep 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.
Mb will we add the formatting script first, and then the new rules?
@@ -3,12 +3,12 @@ | |||
#include "common/smart_ptrs/intrusive_ptr.h" | |||
|
|||
#ifndef INCLUDED_FROM_KPHP_CORE | |||
#error "this file must be included only from runtime-core.h" | |||
#error "this file must be included only from runtime-core.h" |
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.
+1 for macro indentation
ReflowComments: true | ||
SortIncludes: true | ||
SpaceAfterCStyleCast: false | ||
SpaceAfterTemplateKeyword: false |
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.
Includes are sorted implicitly by setting base variant on LLVM, I suppose.
3736a14
to
6fcdf6f
Compare
3418219
to
fa623c6
Compare
fa623c6
to
e2ff8dc
Compare
03adca9
to
d113357
Compare
eb36bfa
to
4e20e4f
Compare
f17d303
to
948eec1
Compare
948eec1
to
9d63b68
Compare
1543212
to
3286da4
Compare
contents: read | ||
|
||
on: | ||
pull_request: |
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 would add a paths
section and specify the paths to the folders where we want to check the new code.
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.
Just in case.
This will need to be put in another MR so that after adding the MR to .git-blame-ignore-revs
we don't lose its history.
@@ -0,0 +1,41 @@ | |||
name: "Check code formatting" | |||
|
|||
permissions: |
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.
What's that for?
- name: Check for formatting changes | ||
run: | | ||
# Check if any files were modified by clang-format | ||
git diff --exit-code |
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.
It can be shortened to:
git diff --exit-code || ( echo "Code is not formatted. Please run clang-format." && exit 1 )
:)
No description provided.