Lunderberg commented on pull request #10101:
URL: https://github.com/apache/tvm/pull/10101#issuecomment-1060856837


   > @Lunderberg wouldn't it be great if we worked towards being able to do 
that? :smile_cat: Personally I think we should encourage patches like this 
which improve our coding standards and follow the guidelines we set out for 
ourselves.
   
   @Mousius Definitely agreed, and I'd like for it to be possible, either with 
a CI step or a standard pre-commit hook to format any modified files.  I 
haven't had the bandwidth lately, but in case anybody reading this does, the 
options I used to search were as follows:
   
   * Disable all clang-tidy passes except 
[readability-identifier-naming](https://clang.llvm.org/extra/clang-tidy/checks/readability-identifier-naming.html)
 with `-checks=-*,readability-identifier-naming`
   * Set the option for 
[PrivateMemberCase](https://clang.llvm.org/extra/clang-tidy/checks/readability-identifier-naming.html#cmdoption-arg-privatemembercase)
 and 
[PublicMemberCase](https://clang.llvm.org/extra/clang-tidy/checks/readability-identifier-naming.html#cmdoption-arg-publicmembercase)
 to `lower_case`
   * Set the option for 
[PrivateMemberSuffix](https://clang.llvm.org/extra/clang-tidy/checks/readability-identifier-naming.html#cmdoption-arg-privatemembersuffix)
 to `_`
   * Set the option for 
[PublicMemberSuffix](https://clang.llvm.org/extra/clang-tidy/checks/readability-identifier-naming.html#cmdoption-arg-publicmembersuffix)
 to an empty string.
   
   > Having said that, the correct approach under the Google C++ Guidelines is 
all data should be _ suffixed and getters added iirc?
   
   It does, yes.  The reasoning is that private member variables with 
getters/setters can be replaced, while maintaining the same external behavior, 
but there is no way to replace public member variables without breaking at 
least some previously-allowed behavior.  Essentially, structs to represent 
data, and classes to represent behavior, with no mixing allowed between them.  
I like doing so overall, but it would be a very dramatic shift from the 
existing public member variables.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to