-
Notifications
You must be signed in to change notification settings - Fork 2
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
linting document update #13
base: develop
Are you sure you want to change the base?
Conversation
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 added some suggestions. I am not sure how flexible is clang-format and how much freedom we have to adjust formatting.
}; | ||
``` | ||
|
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.
}; | |
``` | |
}; | |
} // namespace N |
-enum ShootingHand { SH_Left, SH_Right }; // use upper-case initials as prefix | ||
+enum ShootingHand | ||
{ | ||
SH_Left, | ||
SH_Right | ||
}; // use upper-case initials as prefix |
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.
enum
, if it is short, should be in the same line. I would not make this change.
CONTRIBUTING.md
Outdated
else { | ||
value -= 1; | ||
} |
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.
Consider following:
else { | |
value -= 1; | |
} | |
else | |
{ | |
value -= 1; | |
} |
CONTRIBUTING.md
Outdated
### Position of `else` keyword | ||
|
||
Keyword `else` should follow the if closing brace. |
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.
### Position of `else` keyword | |
Keyword `else` should follow the if closing brace. |
Can get rid of "position of else
" as it is not relevant in Allman case.
-Cowboy::Cowboy() | ||
- : Age(45), GunCount(2) { | ||
- std::cout << "I am alive!" << std::endl; | ||
-} | ||
+Cowboy::Cowboy() : Age(45), GunCount(2) { std::cout << "I am alive!" << std::endl; } | ||
``` |
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.
Can we configure lint to enforce something like this:
-Cowboy::Cowboy() | |
- : Age(45), GunCount(2) { | |
- std::cout << "I am alive!" << std::endl; | |
-} | |
+Cowboy::Cowboy() : Age(45), GunCount(2) { std::cout << "I am alive!" << std::endl; } | |
``` | |
Cowboy::Cowboy() | |
: Age(45), | |
GunCount(2) | |
{ | |
std::cout << "I am alive!" << std::endl; | |
} | |
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 don't know off the top of my head, but there is alot flexibility with clang-format so let me look around.
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.
These are all great recommendations, and I will see to them getting applied both in document and actual application of clang format.
I think this is in a good state. @pelesh would love your opinion. |
This is my first draft of update linting docs. Hopefully this will spur discussion about how we want to to move forward.