Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Feature Request: STL/Boost coding conventions #19497

Open Quuxplusone opened 10 years ago

Quuxplusone commented 10 years ago
Bugzilla Link PR19498
Status NEW
Importance P enhancement
Reported by Gonzalo BG (gonzalo.gadeschi@gmail.com)
Reported on 2014-04-21 08:23:26 -0700
Last modified on 2019-11-14 08:54:42 -0800
Version unspecified
Hardware All All
CC alexfh@google.com, djasper@google.com, klimek@google.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
It would be nice to add STL/Boost coding convention support to clang-tidy.

AFAIK, the coding convention is:
- everything except what is noted bellow: lowercase with words separated by
underscores: like_this,
- concepts and template parameter names: RandomAccessIterator [*],
- acronyms are treated as ordinary names: xml_parser, and
- macro names are all uppercase [**].

[*] standard library implementations uglify template parameters _ToAvoidClashes
with user defined macros (they start with _AnUnderscore).

[**] in the case of Boost, all macros also begin with BOOST_.

I think that:
- this would make for a nice mini-project to get someone started with clang-
tidy,
- this will serve as a nice minimal example for those wanting to extend clang-
tidy with their own coding conventions,
- it could help speed up the review of Boost libraries (benefit for the whole
C++ community), and
- since every C++ developer knows the STL/Boost coding convention, it is also a
nice default/starting coding convention for new projects (more benefit for the
whole C++ community).
Quuxplusone commented 8 years ago
This is mostly covered by readability-identifier-naming check,
see http://clang.llvm.org/extra/clang-tidy/checks/readability-identifier-
naming.html

What is missing there is [*] and [**].