[PATCH] D86671: [clang-tidy] Add new case type to check variables with Hungarian notation

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 14 11:17:56 PDT 2020


njames93 added a comment.

Is this diff been created incorrectly again?

Taking a step back, Is Hungarian notation really a case style, Seems to me its mainly about the prefix and a user may want `DWORD dwUPPER_CASE`, Right now there is no way of adopting that.
Maybe extend the options for hungarian type decls to

  <Type>Case
  <Type>Prefix
  <Type>Suffix
  <Type>HungarianPrefix

`<Type>HungarianPrefix` would likely be a bool and if enabled, it would be prepended to `<Type>Prefix`
I could see a situation like this

  [Options]
  // VariableCase: UPPER_CASE
  // VariablePrefix: PRE_
  // VariableSuffix: _POST
  // VariableHungarianPrefix: true
  
  DWORD MyVariable; -> DWORD dwPRE_MY_VARIABLE_POST;

This would give users full control of exactly how they want their declarations with no hidden surprises.

Granted this approach would require a little rework but it would satisfy more users.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86671/new/

https://reviews.llvm.org/D86671



More information about the cfe-commits mailing list