[all-commits] [llvm/llvm-project] c3d20f: [clang-tidy] readability-identifier-naming disrega...

Nathan James via All-commits all-commits at lists.llvm.org
Mon Jan 27 15:47:56 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c3d20fd472000c7abdc2c9cad051a2ab339709d9
      https://github.com/llvm/llvm-project/commit/c3d20fd472000c7abdc2c9cad051a2ab339709d9
  Author: Nathan <n.james93 at hotmail.co.uk>
  Date:   2020-01-27 (Mon, 27 Jan 2020)

  Changed paths:
    M clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
    M clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.h
    M clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst
    A clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-main-like.cpp

  Log Message:
  -----------
  [clang-tidy] readability-identifier-naming disregards parameters restrictions on main like functions

Summary:
Typically most main functions have the signature:
```
int main(int argc, char *argv[])
```
To stick with convention when renaming parameters we should ignore the `argc` and `argv` names even if the parameter style says they should be renamed. This patch addresses this by checking all ParmVarDecls if they form part of a function with a signature that matches main `int name(int argc, char * argv[], (optional char *env[]))`

Reviewers: aaron.ballman, JonasToth, alexfh, hokein

Reviewed By: aaron.ballman

Subscribers: Mordante, merge_guards_bot, xazax.hun, kristof.beyls, cfe-commits

Tags: #clang, #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D73098




More information about the All-commits mailing list