[PATCH] D82825: [clang-tidy] Added alias llvm-else-after-return.

2020-07-07 Thread Nathan James via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGfc3c693b617f: [clang-tidy] Added alias 
llvm-else-after-return. (authored by njames93).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82825

Files:
  clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/list.rst
  clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst
  clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst


Index: 
clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst
+++ clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst
@@ -77,3 +77,13 @@
the ``if`` statement is the last statement in its parents scope.
Default value is `true`.
 
+
+LLVM alias
+--
+
+There is an alias of this check called llvm-else-after-return.
+In that version the options :option:`WarnOnUnfixable` and 
+:option:`WarnOnConditionVariables` are both set to `false` by default.
+
+This check helps to enforce this `LLVM Coding Standards recommendation
+`_.
Index: clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst
===
--- /dev/null
+++ clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst
@@ -0,0 +1,11 @@
+.. title:: clang-tidy - llvm-else-after-return
+.. meta::
+   :http-equiv=refresh: 5;URL=readability-else-after-return.html
+
+llvm-else-after-return
+==
+
+The llvm-else-after-return check is an alias, please see
+`readability-else-after-return `_
+for more information.
+
Index: clang-tools-extra/docs/clang-tidy/checks/list.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -423,4 +423,5 @@
`hicpp-use-nullptr `_, `modernize-use-nullptr 
`_, "Yes"
`hicpp-use-override `_, `modernize-use-override 
`_, "Yes"
`hicpp-vararg `_, `cppcoreguidelines-pro-type-vararg 
`_,
+   `llvm-else-after-return `_, 
`readability-else-after-return `_, "Yes"
`llvm-qualified-auto `_, 
`readability-qualified-auto `_, "Yes"
Index: clang-tools-extra/docs/ReleaseNotes.rst
===
--- clang-tools-extra/docs/ReleaseNotes.rst
+++ clang-tools-extra/docs/ReleaseNotes.rst
@@ -192,6 +192,11 @@
   :doc:`bugprone-signed-char-misuse
   ` was added.
 
+- New alias :doc:`llvm-else-after-return
+  ` to
+  :doc:`readability-else-after-return
+  ` was added.
+
 Changes in existing checks
 ^^
 
Index: clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
===
--- clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
+++ clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
@@ -9,6 +9,7 @@
 #include "../ClangTidy.h"
 #include "../ClangTidyModule.h"
 #include "../ClangTidyModuleRegistry.h"
+#include "../readability/ElseAfterReturnCheck.h"
 #include "../readability/NamespaceCommentCheck.h"
 #include "../readability/QualifiedAutoCheck.h"
 #include "HeaderGuardCheck.h"
@@ -24,6 +25,8 @@
 class LLVMModule : public ClangTidyModule {
 public:
   void addCheckFactories(ClangTidyCheckFactories ) override {
+CheckFactories.registerCheck(
+"llvm-else-after-return");
 CheckFactories.registerCheck("llvm-header-guard");
 CheckFactories.registerCheck("llvm-include-order");
 CheckFactories.registerCheck(
@@ -40,6 +43,9 @@
   ClangTidyOptions getModuleOptions() override {
 ClangTidyOptions Options;
 Options.CheckOptions["llvm-qualified-auto.AddConstToQualified"] = "0";
+Options.CheckOptions["llvm-else-after-return.WarnOnUnfixable"] = "0";
+Options.CheckOptions["llvm-else-after-return.RefactorConditionVariables"] =
+"0";
 return Options;
   }
 };


Index: clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst
+++ clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst
@@ -77,3 +77,13 @@
the ``if`` statement is the last statement in its parents scope.
Default value is `true`.
 
+
+LLVM alias
+--
+
+There is an alias of this check called llvm-else-after-return.
+In that version the options :option:`WarnOnUnfixable` and 
+:option:`WarnOnConditionVariables` are both set to `false` by default.
+
+This check helps to enforce this `LLVM Coding Standards recommendation

[PATCH] D82825: [clang-tidy] Added alias llvm-else-after-return.

2020-07-06 Thread Nathan James via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGfc3c693b617f: [clang-tidy] Added alias 
llvm-else-after-return. (authored by njames93).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82825

Files:
  clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/list.rst
  clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst
  clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst


Index: 
clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst
+++ clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst
@@ -77,3 +77,13 @@
the ``if`` statement is the last statement in its parents scope.
Default value is `true`.
 
+
+LLVM alias
+--
+
+There is an alias of this check called llvm-else-after-return.
+In that version the options :option:`WarnOnUnfixable` and 
+:option:`WarnOnConditionVariables` are both set to `false` by default.
+
+This check helps to enforce this `LLVM Coding Standards recommendation
+`_.
Index: clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst
===
--- /dev/null
+++ clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst
@@ -0,0 +1,11 @@
+.. title:: clang-tidy - llvm-else-after-return
+.. meta::
+   :http-equiv=refresh: 5;URL=readability-else-after-return.html
+
+llvm-else-after-return
+==
+
+The llvm-else-after-return check is an alias, please see
+`readability-else-after-return `_
+for more information.
+
Index: clang-tools-extra/docs/clang-tidy/checks/list.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -423,4 +423,5 @@
`hicpp-use-nullptr `_, `modernize-use-nullptr 
`_, "Yes"
`hicpp-use-override `_, `modernize-use-override 
`_, "Yes"
`hicpp-vararg `_, `cppcoreguidelines-pro-type-vararg 
`_,
+   `llvm-else-after-return `_, 
`readability-else-after-return `_, "Yes"
`llvm-qualified-auto `_, 
`readability-qualified-auto `_, "Yes"
Index: clang-tools-extra/docs/ReleaseNotes.rst
===
--- clang-tools-extra/docs/ReleaseNotes.rst
+++ clang-tools-extra/docs/ReleaseNotes.rst
@@ -192,6 +192,11 @@
   :doc:`bugprone-signed-char-misuse
   ` was added.
 
+- New alias :doc:`llvm-else-after-return
+  ` to
+  :doc:`readability-else-after-return
+  ` was added.
+
 Changes in existing checks
 ^^
 
Index: clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
===
--- clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
+++ clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
@@ -9,6 +9,7 @@
 #include "../ClangTidy.h"
 #include "../ClangTidyModule.h"
 #include "../ClangTidyModuleRegistry.h"
+#include "../readability/ElseAfterReturnCheck.h"
 #include "../readability/NamespaceCommentCheck.h"
 #include "../readability/QualifiedAutoCheck.h"
 #include "HeaderGuardCheck.h"
@@ -24,6 +25,8 @@
 class LLVMModule : public ClangTidyModule {
 public:
   void addCheckFactories(ClangTidyCheckFactories ) override {
+CheckFactories.registerCheck(
+"llvm-else-after-return");
 CheckFactories.registerCheck("llvm-header-guard");
 CheckFactories.registerCheck("llvm-include-order");
 CheckFactories.registerCheck(
@@ -40,6 +43,9 @@
   ClangTidyOptions getModuleOptions() override {
 ClangTidyOptions Options;
 Options.CheckOptions["llvm-qualified-auto.AddConstToQualified"] = "0";
+Options.CheckOptions["llvm-else-after-return.WarnOnUnfixable"] = "0";
+Options.CheckOptions["llvm-else-after-return.RefactorConditionVariables"] =
+"0";
 return Options;
   }
 };


Index: clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst
+++ clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst
@@ -77,3 +77,13 @@
the ``if`` statement is the last statement in its parents scope.
Default value is `true`.
 
+
+LLVM alias
+--
+
+There is an alias of this check called llvm-else-after-return.
+In that version the options :option:`WarnOnUnfixable` and 
+:option:`WarnOnConditionVariables` are both set to `false` by default.
+
+This check helps to enforce this `LLVM Coding Standards recommendation

[PATCH] D82825: [clang-tidy] Added alias llvm-else-after-return.

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

In D82825#2123186 , @aaron.ballman 
wrote:

> I can see arguments either way on this. Personally, I would not want the 
> check to diagnose this code because that would encourage people to widen the 
> scope and lifetime of `X` or require them to introduce a new compound scope 
> to get the same behavior, and I think that's more problematic than the `else` 
> following a `return`. I am not certain if others feel the same way though.


I'll leave this for a bit before merging and see if anyone else wants a weigh 
in on the default llvm behaviour as this will likely have an effect on other 
contributors


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82825



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


[PATCH] D82825: [clang-tidy] Added alias llvm-else-after-return.

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

In D82825#2123125 , @njames93 wrote:

> In D82825#2122789 , @aaron.ballman 
> wrote:
>
> > Other than the documentation and settling on the option name in the parent 
> > revision, I think this LGTM (the changes will be mechanical and can be done 
> > without further review once the parent commit is in, unless you want more 
> > eyes on it).
>
>
> Are you happy with the reduced warnings in the this alias, when running 
> locally over llvm I noticed a lot of warnings about else after return where 
> condition variables are used. usually of the format
>
>   if (llvm::Expected X = ... ) {
> return *X;
>   }
>   else {
> handle(X.takeError());
>   }


I can see arguments either way on this. Personally, I would not want the check 
to diagnose this code because that would encourage people to widen the scope 
and lifetime of `X` or require them to introduce a new compound scope to get 
the same behavior, and I think that's more problematic than the `else` 
following a `return`. I am not certain if others feel the same way though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82825



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


[PATCH] D82825: [clang-tidy] Added alias llvm-else-after-return.

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

In D82825#2122789 , @aaron.ballman 
wrote:

> Other than the documentation and settling on the option name in the parent 
> revision, I think this LGTM (the changes will be mechanical and can be done 
> without further review once the parent commit is in, unless you want more 
> eyes on it).


Are you happy with the reduced warnings in the this alias, when running locally 
over llvm I noticed a lot of warnings about else after return where condition 
variables are used. usually of the format

  if (llvm::Expected X = ... ) {
return *X;
  }
  else {
handle(X.takeError());
  }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82825



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


[PATCH] D82825: [clang-tidy] Added alias llvm-else-after-return.

2020-06-30 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 274476.
njames93 added a comment.

Moved docs into target check.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82825

Files:
  clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/list.rst
  clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst
  clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst


Index: 
clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst
+++ clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst
@@ -77,3 +77,13 @@
the ``if`` statement is the last statement in its parents scope.
Default value is `true`.
 
+
+LLVM alias
+--
+
+There is an alias of this check called llvm-else-after-return.
+In that version the options :option:`WarnOnUnfixable` and 
+:option:`WarnOnConditionVariables` are both set to `false` by default.
+
+This check helps to enforce this `LLVM Coding Standards recommendation
+`_.
Index: clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst
===
--- /dev/null
+++ clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst
@@ -0,0 +1,11 @@
+.. title:: clang-tidy - llvm-else-after-return
+.. meta::
+   :http-equiv=refresh: 5;URL=readability-else-after-return.html
+
+llvm-else-after-return
+==
+
+The llvm-else-after-return check is an alias, please see
+`readability-else-after-return `_
+for more information.
+
Index: clang-tools-extra/docs/clang-tidy/checks/list.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -423,4 +423,5 @@
`hicpp-use-nullptr `_, `modernize-use-nullptr 
`_, "Yes"
`hicpp-use-override `_, `modernize-use-override 
`_, "Yes"
`hicpp-vararg `_, `cppcoreguidelines-pro-type-vararg 
`_,
+   `llvm-else-after-return `_, 
`readability-else-after-return `_, "Yes"
`llvm-qualified-auto `_, 
`readability-qualified-auto `_, "Yes"
Index: clang-tools-extra/docs/ReleaseNotes.rst
===
--- clang-tools-extra/docs/ReleaseNotes.rst
+++ clang-tools-extra/docs/ReleaseNotes.rst
@@ -192,6 +192,11 @@
   :doc:`bugprone-signed-char-misuse
   ` was added.
 
+- New alias :doc:`llvm-else-after-return
+  ` to
+  :doc:`readability-else-after-return
+  ` was added.
+
 Changes in existing checks
 ^^
 
Index: clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
===
--- clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
+++ clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
@@ -9,6 +9,7 @@
 #include "../ClangTidy.h"
 #include "../ClangTidyModule.h"
 #include "../ClangTidyModuleRegistry.h"
+#include "../readability/ElseAfterReturnCheck.h"
 #include "../readability/NamespaceCommentCheck.h"
 #include "../readability/QualifiedAutoCheck.h"
 #include "HeaderGuardCheck.h"
@@ -24,6 +25,8 @@
 class LLVMModule : public ClangTidyModule {
 public:
   void addCheckFactories(ClangTidyCheckFactories ) override {
+CheckFactories.registerCheck(
+"llvm-else-after-return");
 CheckFactories.registerCheck("llvm-header-guard");
 CheckFactories.registerCheck("llvm-include-order");
 CheckFactories.registerCheck(
@@ -40,6 +43,9 @@
   ClangTidyOptions getModuleOptions() override {
 ClangTidyOptions Options;
 Options.CheckOptions["llvm-qualified-auto.AddConstToQualified"] = "0";
+Options.CheckOptions["llvm-else-after-return.WarnOnUnfixable"] = "0";
+Options.CheckOptions["llvm-else-after-return.RefactorConditionVariables"] =
+"0";
 return Options;
   }
 };


Index: clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst
+++ clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst
@@ -77,3 +77,13 @@
the ``if`` statement is the last statement in its parents scope.
Default value is `true`.
 
+
+LLVM alias
+--
+
+There is an alias of this check called llvm-else-after-return.
+In that version the options :option:`WarnOnUnfixable` and 
+:option:`WarnOnConditionVariables` are both set to `false` by default.
+
+This check helps to enforce this `LLVM Coding Standards recommendation
+`_.

[PATCH] D82825: [clang-tidy] Added alias llvm-else-after-return.

2020-06-30 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.

Other than the documentation and settling on the option name in the parent 
revision, I think this LGTM (the changes will be mechanical and can be done 
without further review once the parent commit is in, unless you want more eyes 
on it).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82825



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


[PATCH] D82825: [clang-tidy] Added alias llvm-else-after-return.

2020-06-30 Thread Nathan James via Phabricator via cfe-commits
njames93 marked an inline comment as done.
njames93 added inline comments.



Comment at: 
clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst:3
+.. meta::
+   :http-equiv=refresh: 5;URL=readability-else-after-return.html
+

aaron.ballman wrote:
> Hmmm, this means users have five seconds to read the text below before they 
> get redirected. We usually just have the short text about the check being an 
> alias (the first paragraph) and then put the remainder of the information in 
> the target check if it's important.
Fair point I'll put the extra information in the target check


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82825



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


[PATCH] D82825: [clang-tidy] Added alias llvm-else-after-return.

2020-06-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments.



Comment at: 
clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst:3
+.. meta::
+   :http-equiv=refresh: 5;URL=readability-else-after-return.html
+

Hmmm, this means users have five seconds to read the text below before they get 
redirected. We usually just have the short text about the check being an alias 
(the first paragraph) and then put the remainder of the information in the 
target check if it's important.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82825



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


[PATCH] D82825: [clang-tidy] Added alias llvm-else-after-return.

2020-06-30 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 274359.
njames93 added a comment.

Address doc backticks


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82825

Files:
  clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/list.rst
  clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst


Index: clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst
===
--- /dev/null
+++ clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst
@@ -0,0 +1,17 @@
+.. title:: clang-tidy - llvm-else-after-return
+.. meta::
+   :http-equiv=refresh: 5;URL=readability-else-after-return.html
+
+llvm-else-after-return
+==
+
+The llvm-else-after-return check is an alias, please see
+`readability-else-after-return `_
+for more information.
+
+This check helps to enforce this `LLVM Coding Standards recommendation
+`_.
+
+Note: In this alias the options `WarnOnUnfixable` and 
+`RefactorConditionVariables` are both set to `false` by default.
+
Index: clang-tools-extra/docs/clang-tidy/checks/list.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -423,4 +423,5 @@
`hicpp-use-nullptr `_, `modernize-use-nullptr 
`_, "Yes"
`hicpp-use-override `_, `modernize-use-override 
`_, "Yes"
`hicpp-vararg `_, `cppcoreguidelines-pro-type-vararg 
`_,
+   `llvm-else-after-return `_, 
`readability-else-after-return `_, "Yes"
`llvm-qualified-auto `_, 
`readability-qualified-auto `_, "Yes"
Index: clang-tools-extra/docs/ReleaseNotes.rst
===
--- clang-tools-extra/docs/ReleaseNotes.rst
+++ clang-tools-extra/docs/ReleaseNotes.rst
@@ -192,6 +192,11 @@
   :doc:`bugprone-signed-char-misuse
   ` was added.
 
+- New alias :doc:`llvm-else-after-return
+  ` to
+  :doc:`readability-else-after-return
+  ` was added.
+
 Changes in existing checks
 ^^
 
Index: clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
===
--- clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
+++ clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
@@ -9,6 +9,7 @@
 #include "../ClangTidy.h"
 #include "../ClangTidyModule.h"
 #include "../ClangTidyModuleRegistry.h"
+#include "../readability/ElseAfterReturnCheck.h"
 #include "../readability/NamespaceCommentCheck.h"
 #include "../readability/QualifiedAutoCheck.h"
 #include "HeaderGuardCheck.h"
@@ -24,6 +25,8 @@
 class LLVMModule : public ClangTidyModule {
 public:
   void addCheckFactories(ClangTidyCheckFactories ) override {
+CheckFactories.registerCheck(
+"llvm-else-after-return");
 CheckFactories.registerCheck("llvm-header-guard");
 CheckFactories.registerCheck("llvm-include-order");
 CheckFactories.registerCheck(
@@ -40,6 +43,9 @@
   ClangTidyOptions getModuleOptions() override {
 ClangTidyOptions Options;
 Options.CheckOptions["llvm-qualified-auto.AddConstToQualified"] = "0";
+Options.CheckOptions["llvm-else-after-return.WarnOnUnfixable"] = "0";
+Options.CheckOptions["llvm-else-after-return.RefactorConditionVariables"] =
+"0";
 return Options;
   }
 };


Index: clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst
===
--- /dev/null
+++ clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst
@@ -0,0 +1,17 @@
+.. title:: clang-tidy - llvm-else-after-return
+.. meta::
+   :http-equiv=refresh: 5;URL=readability-else-after-return.html
+
+llvm-else-after-return
+==
+
+The llvm-else-after-return check is an alias, please see
+`readability-else-after-return `_
+for more information.
+
+This check helps to enforce this `LLVM Coding Standards recommendation
+`_.
+
+Note: In this alias the options `WarnOnUnfixable` and 
+`RefactorConditionVariables` are both set to `false` by default.
+
Index: clang-tools-extra/docs/clang-tidy/checks/list.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -423,4 +423,5 @@
`hicpp-use-nullptr `_, `modernize-use-nullptr `_, "Yes"
`hicpp-use-override `_, `modernize-use-override `_, "Yes"
`hicpp-vararg `_, `cppcoreguidelines-pro-type-vararg `_,
+   `llvm-else-after-return `_, `readability-else-after-return `_, "Yes"
`llvm-qualified-auto `_, `readability-qualified-auto `_, "Yes"
Index: 

[PATCH] D82825: [clang-tidy] Added alias llvm-else-after-return.

2020-06-29 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments.



Comment at: 
clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst:15
+
+Note: In this alias the options ``WarnOnUnfixable`` and 
+``RefactorConditionVariables`` are both set to ``false`` by default.

Please use single back-ticks for option names and values.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82825



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


[PATCH] D82825: [clang-tidy] Added alias llvm-else-after-return.

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

This is supposed to have a parent revision D82824 
 but for some reason phab won't let me add it


Added an alias llvm-else-after-return from readability-else-after-return to 
help enforce one of the llvm coding guidelines.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82825

Files:
  clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/list.rst
  clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst


Index: clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst
===
--- /dev/null
+++ clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst
@@ -0,0 +1,17 @@
+.. title:: clang-tidy - llvm-else-after-return
+.. meta::
+   :http-equiv=refresh: 5;URL=readability-else-after-return.html
+
+llvm-else-after-return
+==
+
+The llvm-else-after-return check is an alias, please see
+`readability-else-after-return `_
+for more information.
+
+This check helps to enforce this `LLVM Coding Standards recommendation
+`_.
+
+Note: In this alias the options ``WarnOnUnfixable`` and 
+``RefactorConditionVariables`` are both set to ``false`` by default.
+
Index: clang-tools-extra/docs/clang-tidy/checks/list.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -423,4 +423,5 @@
`hicpp-use-nullptr `_, `modernize-use-nullptr 
`_, "Yes"
`hicpp-use-override `_, `modernize-use-override 
`_, "Yes"
`hicpp-vararg `_, `cppcoreguidelines-pro-type-vararg 
`_,
+   `llvm-else-after-return `_, 
`readability-else-after-return `_, "Yes"
`llvm-qualified-auto `_, 
`readability-qualified-auto `_, "Yes"
Index: clang-tools-extra/docs/ReleaseNotes.rst
===
--- clang-tools-extra/docs/ReleaseNotes.rst
+++ clang-tools-extra/docs/ReleaseNotes.rst
@@ -192,6 +192,11 @@
   :doc:`bugprone-signed-char-misuse
   ` was added.
 
+- New alias :doc:`llvm-else-after-return
+  ` to
+  :doc:`readability-else-after-return
+  ` was added.
+
 Changes in existing checks
 ^^
 
Index: clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
===
--- clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
+++ clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
@@ -9,6 +9,7 @@
 #include "../ClangTidy.h"
 #include "../ClangTidyModule.h"
 #include "../ClangTidyModuleRegistry.h"
+#include "../readability/ElseAfterReturnCheck.h"
 #include "../readability/NamespaceCommentCheck.h"
 #include "../readability/QualifiedAutoCheck.h"
 #include "HeaderGuardCheck.h"
@@ -24,6 +25,8 @@
 class LLVMModule : public ClangTidyModule {
 public:
   void addCheckFactories(ClangTidyCheckFactories ) override {
+CheckFactories.registerCheck(
+"llvm-else-after-return");
 CheckFactories.registerCheck("llvm-header-guard");
 CheckFactories.registerCheck("llvm-include-order");
 CheckFactories.registerCheck(
@@ -40,6 +43,9 @@
   ClangTidyOptions getModuleOptions() override {
 ClangTidyOptions Options;
 Options.CheckOptions["llvm-qualified-auto.AddConstToQualified"] = "0";
+Options.CheckOptions["llvm-else-after-return.WarnOnUnfixable"] = "0";
+Options.CheckOptions["llvm-else-after-return.RefactorConditionVariables"] =
+"0";
 return Options;
   }
 };


Index: clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst
===
--- /dev/null
+++ clang-tools-extra/docs/clang-tidy/checks/llvm-else-after-return.rst
@@ -0,0 +1,17 @@
+.. title:: clang-tidy - llvm-else-after-return
+.. meta::
+   :http-equiv=refresh: 5;URL=readability-else-after-return.html
+
+llvm-else-after-return
+==
+
+The llvm-else-after-return check is an alias, please see
+`readability-else-after-return `_
+for more information.
+
+This check helps to enforce this `LLVM Coding Standards recommendation
+`_.
+
+Note: In this alias the options ``WarnOnUnfixable`` and 
+``RefactorConditionVariables`` are both set to ``false`` by default.
+
Index: clang-tools-extra/docs/clang-tidy/checks/list.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -423,4 +423,5 @@
`hicpp-use-nullptr `_, 

[PATCH] D82825: [clang-tidy] Added alias llvm-else-after-return.

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

This is supposed to have a parent revision D82824 
 but for some reason phab won't let me add it


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82825



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