[PATCH] D82711: [clang-tidy] Fix hicpp-named-paramater

2020-06-29 Thread Nathan James via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1f228e572da2: [clang-tidy] Fix hicpp-named-paramater 
(authored by njames93).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82711

Files:
  clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp


Index: clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp
===
--- clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp
+++ clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp
@@ -9,6 +9,7 @@
 #include "../ClangTidy.h"
 #include "../ClangTidyModule.h"
 #include "../ClangTidyModuleRegistry.h"
+#include "../bugprone/UndelegatedConstructorCheck.h"
 #include "../bugprone/UseAfterMoveCheck.h"
 #include "../cppcoreguidelines/AvoidGotoCheck.h"
 #include "../cppcoreguidelines/NoMallocCheck.h"
@@ -20,7 +21,6 @@
 #include "../google/ExplicitConstructorCheck.h"
 #include "../misc/NewDeleteOverloadsCheck.h"
 #include "../misc/StaticAssertCheck.h"
-#include "../bugprone/UndelegatedConstructorCheck.h"
 #include "../modernize/AvoidCArraysCheck.h"
 #include "../modernize/DeprecatedHeadersCheck.h"
 #include "../modernize/UseAutoCheck.h"
@@ -34,7 +34,7 @@
 #include "../performance/NoexceptMoveConstructorCheck.h"
 #include "../readability/BracesAroundStatementsCheck.h"
 #include "../readability/FunctionSizeCheck.h"
-#include "../readability/IdentifierNamingCheck.h"
+#include "../readability/NamedParameterCheck.h"
 #include "../readability/UppercaseLiteralSuffixCheck.h"
 #include "ExceptionBaseclassCheck.h"
 #include "MultiwayPathsCoveredCheck.h"
@@ -65,7 +65,7 @@
 "hicpp-explicit-conversions");
 CheckFactories.registerCheck(
 "hicpp-function-size");
-CheckFactories.registerCheck(
+CheckFactories.registerCheck(
 "hicpp-named-parameter");
 CheckFactories.registerCheck(
 "hicpp-invalid-access-moved");


Index: clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp
===
--- clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp
+++ clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp
@@ -9,6 +9,7 @@
 #include "../ClangTidy.h"
 #include "../ClangTidyModule.h"
 #include "../ClangTidyModuleRegistry.h"
+#include "../bugprone/UndelegatedConstructorCheck.h"
 #include "../bugprone/UseAfterMoveCheck.h"
 #include "../cppcoreguidelines/AvoidGotoCheck.h"
 #include "../cppcoreguidelines/NoMallocCheck.h"
@@ -20,7 +21,6 @@
 #include "../google/ExplicitConstructorCheck.h"
 #include "../misc/NewDeleteOverloadsCheck.h"
 #include "../misc/StaticAssertCheck.h"
-#include "../bugprone/UndelegatedConstructorCheck.h"
 #include "../modernize/AvoidCArraysCheck.h"
 #include "../modernize/DeprecatedHeadersCheck.h"
 #include "../modernize/UseAutoCheck.h"
@@ -34,7 +34,7 @@
 #include "../performance/NoexceptMoveConstructorCheck.h"
 #include "../readability/BracesAroundStatementsCheck.h"
 #include "../readability/FunctionSizeCheck.h"
-#include "../readability/IdentifierNamingCheck.h"
+#include "../readability/NamedParameterCheck.h"
 #include "../readability/UppercaseLiteralSuffixCheck.h"
 #include "ExceptionBaseclassCheck.h"
 #include "MultiwayPathsCoveredCheck.h"
@@ -65,7 +65,7 @@
 "hicpp-explicit-conversions");
 CheckFactories.registerCheck(
 "hicpp-function-size");
-CheckFactories.registerCheck(
+CheckFactories.registerCheck(
 "hicpp-named-parameter");
 CheckFactories.registerCheck(
 "hicpp-invalid-access-moved");
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D82711: [clang-tidy] Fix hicpp-named-paramater

2020-06-29 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

In D82711#2119714 , @njames93 wrote:

> In D82711#2119651 , @aaron.ballman 
> wrote:
>
> > I do not understand the justification here -- `IdentifierNamingCheck` and 
> > `NamedParameterCheck` are two different checks. How do you know that this 
> > swap continues to honor the HIC++ coding standard?
>
>
> Because thats what the documentation says
>  In docs/checks/hicpp-named-paramater.rst:
>
>   hicpp-named-parameter
>   This check is an alias for readability-named-parameter.
>  
>   Implements rule 8.2.1.
>
> From 
> https://www.perforce.com/resources/qac/high-integrity-cpp-coding-standard/definitions:
>
>   8.2.1 Make parameter names absent or identical in all declarations
>
> Its fairly obvious this has been incorrect since its inception. Arguable 
> readability-named-paramater doesn't quite cover the extent of the HIC++ 
> coding standard, but it goes a lot further than the identifier-naming-check 
> does.


Oof! Good catch! Thanks for the explanation, I was missing that bit.

> EDIT: Down the line I may create a check that fully enforces rule 8.2.1, but 
> for now this is a good small step

Agreed. LGTM


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82711



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D82711: [clang-tidy] Fix hicpp-named-paramater

2020-06-29 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment.

In D82711#2119651 , @aaron.ballman 
wrote:

> I do not understand the justification here -- `IdentifierNamingCheck` and 
> `NamedParameterCheck` are two different checks. How do you know that this 
> swap continues to honor the HIC++ coding standard?


Because thats what the documentation says
In docs/checks/hicpp-named-paramater.rst:

  hicpp-named-parameter
  This check is an alias for readability-named-parameter.
  
  Implements rule 8.2.1.

From 
https://www.perforce.com/resources/qac/high-integrity-cpp-coding-standard/definitions:

  8.2.1 Make parameter names absent or identical in all declarations

Its fairly obvious this has been incorrect since its inception. Arguable 
readability-named-paramater doesn't quite cover the extent of the HIC++ coding 
standard, but it goes a lot further than the identifier-naming-check does.

EDIT: Down the line I may create a check that fully enforces rule 8.2.1, but 
for now this is a good small step


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82711



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D82711: [clang-tidy] Fix hicpp-named-paramater

2020-06-29 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment.

I do not understand the justification here -- `IdentifierNamingCheck` and 
`NamedParameterCheck` are two different checks. How do you know that this swap 
continues to honor the HIC++ coding standard?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82711



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D82711: [clang-tidy] Fix hicpp-named-paramater

2020-06-29 Thread Nathan James via Phabricator via cfe-commits
njames93 created this revision.
njames93 added reviewers: aaron.ballman, jbcoe.
Herald added subscribers: cfe-commits, xazax.hun.
Herald added a project: clang.

Currently this alias instantiates the readability-identifier-naming check, just 
swap it out to use the readability-named-paramater check.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82711

Files:
  clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp


Index: clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp
===
--- clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp
+++ clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp
@@ -9,6 +9,7 @@
 #include "../ClangTidy.h"
 #include "../ClangTidyModule.h"
 #include "../ClangTidyModuleRegistry.h"
+#include "../bugprone/UndelegatedConstructorCheck.h"
 #include "../bugprone/UseAfterMoveCheck.h"
 #include "../cppcoreguidelines/AvoidGotoCheck.h"
 #include "../cppcoreguidelines/NoMallocCheck.h"
@@ -20,7 +21,6 @@
 #include "../google/ExplicitConstructorCheck.h"
 #include "../misc/NewDeleteOverloadsCheck.h"
 #include "../misc/StaticAssertCheck.h"
-#include "../bugprone/UndelegatedConstructorCheck.h"
 #include "../modernize/AvoidCArraysCheck.h"
 #include "../modernize/DeprecatedHeadersCheck.h"
 #include "../modernize/UseAutoCheck.h"
@@ -34,7 +34,7 @@
 #include "../performance/NoexceptMoveConstructorCheck.h"
 #include "../readability/BracesAroundStatementsCheck.h"
 #include "../readability/FunctionSizeCheck.h"
-#include "../readability/IdentifierNamingCheck.h"
+#include "../readability/NamedParameterCheck.h"
 #include "../readability/UppercaseLiteralSuffixCheck.h"
 #include "ExceptionBaseclassCheck.h"
 #include "MultiwayPathsCoveredCheck.h"
@@ -65,7 +65,7 @@
 "hicpp-explicit-conversions");
 CheckFactories.registerCheck(
 "hicpp-function-size");
-CheckFactories.registerCheck(
+CheckFactories.registerCheck(
 "hicpp-named-parameter");
 CheckFactories.registerCheck(
 "hicpp-invalid-access-moved");


Index: clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp
===
--- clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp
+++ clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp
@@ -9,6 +9,7 @@
 #include "../ClangTidy.h"
 #include "../ClangTidyModule.h"
 #include "../ClangTidyModuleRegistry.h"
+#include "../bugprone/UndelegatedConstructorCheck.h"
 #include "../bugprone/UseAfterMoveCheck.h"
 #include "../cppcoreguidelines/AvoidGotoCheck.h"
 #include "../cppcoreguidelines/NoMallocCheck.h"
@@ -20,7 +21,6 @@
 #include "../google/ExplicitConstructorCheck.h"
 #include "../misc/NewDeleteOverloadsCheck.h"
 #include "../misc/StaticAssertCheck.h"
-#include "../bugprone/UndelegatedConstructorCheck.h"
 #include "../modernize/AvoidCArraysCheck.h"
 #include "../modernize/DeprecatedHeadersCheck.h"
 #include "../modernize/UseAutoCheck.h"
@@ -34,7 +34,7 @@
 #include "../performance/NoexceptMoveConstructorCheck.h"
 #include "../readability/BracesAroundStatementsCheck.h"
 #include "../readability/FunctionSizeCheck.h"
-#include "../readability/IdentifierNamingCheck.h"
+#include "../readability/NamedParameterCheck.h"
 #include "../readability/UppercaseLiteralSuffixCheck.h"
 #include "ExceptionBaseclassCheck.h"
 #include "MultiwayPathsCoveredCheck.h"
@@ -65,7 +65,7 @@
 "hicpp-explicit-conversions");
 CheckFactories.registerCheck(
 "hicpp-function-size");
-CheckFactories.registerCheck(
+CheckFactories.registerCheck(
 "hicpp-named-parameter");
 CheckFactories.registerCheck(
 "hicpp-invalid-access-moved");
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits