[PATCH] D156056: [clang-tidy] Initialize DiagnosticEngine in ExpandModularHeaders

2023-07-23 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. A thought came to mind - since we are doing workarounds anyway, would it be easier to ask people to simply add `-clang-diagnostic*` to the `Checks` in their config file? It's fair to assume they will get those warnings when compiling the code. I feel the more work

[PATCH] D156056: [clang-tidy] Initialize DiagnosticEngine in ExpandModularHeaders

2023-07-23 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added inline comments. Comment at: clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp:75 + Diags(new DiagnosticIDs, +new DiagnosticOptions(Compiler.getDiagnosticOpts()), new ForwardingDiagnosticConsumer(Compiler.getDiagnos

[PATCH] D156056: [clang-tidy] Initialize DiagnosticEngine in ExpandModularHeaders

2023-07-24 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added inline comments. Comment at: clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp:75 + Diags(new DiagnosticIDs, +new DiagnosticOptions(Compiler.getDiagnosticOpts()), new ForwardingDiagnosticConsumer(Compiler.getDiagnos

[PATCH] D156056: [clang-tidy] Initialize DiagnosticEngine in ExpandModularHeaders

2023-07-24 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added inline comments. Comment at: clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp:75 + Diags(new DiagnosticIDs, +new DiagnosticOptions(Compiler.getDiagnosticOpts()), new ForwardingDiagnosticConsumer(Compiler.getDiagnos

[PATCH] D155890: [clang-tidy] Add folly::Optional to unchecked-optional-access

2023-07-24 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. The review is marked as accepted, should we land it? Let me know if you need help with that :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155890/new/ https://reviews.llvm.org/D155890 _

[PATCH] D156056: [clang-tidy] Initialize DiagnosticEngine in ExpandModularHeaders

2023-07-24 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp accepted this revision. carlosgalvezp added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp:75 + Diags(new DiagnosticIDs, +new DiagnosticOptions(Compiler.

[PATCH] D156161: [clang-tidy] Add --experimental-enable-module-headers-parsing option

2023-07-24 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. Please squash into previous patch, I see no reason to make them into separate commits. The first one is missing Release Notes, for example. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156161/new/ https://reviews.ll

[PATCH] D156024: [clang-tidy] Add --experimental-disable-module-headers-parsing option

2023-07-24 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added inline comments. Comment at: clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h:202 + bool canEnableModuleHeadersParsing() const { +return !DisableModuleHeadersParsing; Add docs? Comment at: clang-tools-extra/

[PATCH] D156161: [clang-tidy] Add --enable-module-headers-parsing option

2023-07-25 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. Do we want to keep the `experimental` word in the flag? Comment at: clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp:266 +static cl::opt EnableModuleHeadersParsing("enable-module-headers-parsing", +

[PATCH] D156161: [clang-tidy] Add --enable-module-headers-parsing option

2023-07-25 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp accepted this revision. carlosgalvezp added a comment. This revision is now accepted and ready to land. LGTM! Feel free to add the comment about the implications of using the flag in the docs. Comment at: clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp:270 +f

[PATCH] D156303: [clang-tidy] Remove AnalyzeTemporaryDestructors configuration option

2023-07-26 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp created this revision. Herald added subscribers: PiotrZSL, xazax.hun. Herald added a reviewer: njames93. Herald added a project: All. carlosgalvezp requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Since it was depre

[PATCH] D156303: [clang-tidy] Remove AnalyzeTemporaryDestructors configuration option

2023-07-26 Thread Carlos Galvez via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGb7c6b39651b3: [clang-tidy] Remove AnalyzeTemporaryDestructors configuration option (authored by carlosgalvezp). Repository: rG LLVM Github Monorep

[PATCH] D156452: [clang-tidy] Sort options in --dump-config

2023-07-27 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. Looks great, small comments! Comment at: clang-tools-extra/clang-tidy/ClangTidyOptions.cpp:89 if (IO.outputting()) { +std::vector> SortedOptions; +SortedOptions.reserve(Options.size()); Maybe add a one-line comment like

[PATCH] D156452: [clang-tidy] Sort options in --dump-config

2023-07-27 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp accepted this revision. carlosgalvezp added a comment. This revision is now accepted and ready to land. LGTM, thanks for fixing! Comment at: clang-tools-extra/clang-tidy/ClangTidyOptions.cpp:90 +std::vector> SortedOptions; +SortedOptions.reserve(Options.si

[PATCH] D157326: [clang-tidy] Fix handling of out-of-line functions in readability-static-accessed-through-instance

2023-08-14 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp accepted this revision. carlosgalvezp added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157326/new/ https://reviews.llvm.org/D157326

[PATCH] D157374: [clang-tidy] Ignore decltype in misc-redundant-expression

2023-08-14 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp accepted this revision. carlosgalvezp added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157374/new/ https://reviews.llvm.org/D157374 _

[PATCH] D156608: [clang-tidy] Do not warn on macros starting with underscore and lowercase letter in bugprone-reserved-identifier

2023-07-30 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp created this revision. Herald added subscribers: PiotrZSL, xazax.hun. Herald added a reviewer: njames93. Herald added a project: All. carlosgalvezp requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Fixes #64130 Rep

[PATCH] D156608: [clang-tidy] Do not warn on macros starting with underscore and lowercase letter in bugprone-reserved-identifier

2023-07-30 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp updated this revision to Diff 545415. carlosgalvezp added a comment. Remove extra newline Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156608/new/ https://reviews.llvm.org/D156608 Files: clang-tools-extra/clang-tidy/bugprone/Reser

[PATCH] D156608: [clang-tidy] Do not warn on macros starting with underscore and lowercase letter in bugprone-reserved-identifier

2023-07-30 Thread Carlos Galvez via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2992d084774f: [clang-tidy] Do not warn on macros starting with underscore and lowercase… (authored by carlosgalvezp). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llv

[PATCH] D156624: [clang-tidy] Access checks not done classes derived of std::array

2023-07-30 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. What about the use case of privately inheriting `std::array`, and overriding the `operator[]` there with bounds check? Would it be possible to check only _public_ inheritance? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156624/new/ https://reviews.llvm

[PATCH] D157182: [clang-tidy][NFC] Update documentation for hicpp-avoid-goto

2023-08-05 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp accepted this revision. carlosgalvezp added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157182/new/ https://reviews.llvm.org/D157182

[PATCH] D157181: [clang-tidy] Re-add cppcoreguidelines-macro-to-enum alias

2023-08-05 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp accepted this revision. carlosgalvezp added a comment. This revision is now accepted and ready to land. Strange, it seems the alias was never fully added? https://reviews.llvm.org/D117522 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1

[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

2023-08-05 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. In D145138#4561799 , @PiotrZSL wrote: > Test are failing, and I do not think that converting c-strings into > std::array is a good idea +1, they should typically be `char const*` instead. Repository: rG LLVM Github

[PATCH] D157178: [clang-tidy] Fix inline namespaces in llvm-namespace-comment

2023-08-05 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp accepted this revision. carlosgalvezp added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157178/new/ https://reviews.llvm.org/D157178 _

[PATCH] D157180: [clang-tidy] Exclude class/struct scope variables from cppcoreguidelines-avoid-non-const-global-variables

2023-08-05 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp accepted this revision. carlosgalvezp added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157180/new/ https://reviews.llvm.org/D157180

[PATCH] D157185: [clang-tidy] Fix false-positives in performanc-noexcept-swap

2023-08-05 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp accepted this revision. carlosgalvezp added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clang-tidy/performance/NoexceptSwapCheck.cpp:22 Finder->addMatcher( - functionDecl(unless(isDeleted()), hasName("swap

[PATCH] D157190: [clang-tidy] Fixed false-negative in readability-identifier-naming

2023-08-05 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp accepted this revision. carlosgalvezp added a comment. This revision is now accepted and ready to land. LGTM, minor question that can be fixed post-review unless you want to discuss further! Comment at: clang-tools-extra/test/clang-tidy/checkers/readability/iden

[PATCH] D157181: [clang-tidy] Re-add cppcoreguidelines-macro-to-enum alias

2023-08-05 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. In D157181#4563170 , @PiotrZSL wrote: > In D157181#4563147 , @carlosgalvezp > wrote: > >> Strange, it seems the alias was never fully added? >> https://reviews.llvm.org/D117522 > >

[PATCH] D157185: [clang-tidy] Fix false-positives in performanc-noexcept-swap

2023-08-05 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/NoexceptSwapCheck.cpp:31 + // Match function with 2 arguments, both are non-const references to same type + // and return void void swap(Type&, Type&) + auto FunctionMatcher = allOf( ---

[PATCH] D157239: [clang-tidy] Implement bugprone-incorrect-enable-if

2023-08-06 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. Do you have plans to also detect the bugprone scenario described in the `Notes` here? https://en.cppreference.com/w/cpp/types/enable_if No need to have it in this patch, but would be good to keep it in mind if we want to add it in the future (preferably) or creat

[PATCH] D153458: [clang-tidy] Model noexcept more properly in bugprone-exception-escape

2023-07-16 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. Looks good, great to see all these issues fixed! Have a couple small comments. Comment at: clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp:319 +static bool cannotThrow(const FunctionDecl *Func) { + const auto *FunProto = Func->getType(

[PATCH] D151495: [clang-tidy] Improve build-in type handling in bugprone-swapped-arguments

2023-07-16 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp accepted this revision. carlosgalvezp added a comment. This revision is now accepted and ready to land. LGTM, thank you for the fix! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151495/new/ https://reviews.llvm.org/D151495 _

[PATCH] D153458: [clang-tidy] Model noexcept more properly in bugprone-exception-escape

2023-07-17 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp accepted this revision. carlosgalvezp added a comment. This revision is now accepted and ready to land. LGTM, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153458/new/ https://reviews.llvm.org/D153458

[PATCH] D158929: [clang-tidy] Add exit code support to clang-tidy-diff.py

2023-08-31 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp accepted this revision. carlosgalvezp added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158929/new/ https://reviews.llvm.org/D158929

[PATCH] D56644: [clang-tidy] readability-container-size-empty handle std::string length()

2023-08-31 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp accepted this revision. carlosgalvezp added a comment. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56644/new/ https://reviews.llvm.org/D56644 ___ cfe-commits mailing list cfe-commit

[PATCH] D158486: [clang-tidy] Ignore used special-members in modernize-use-equals-delete

2023-09-03 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp accepted this revision. carlosgalvezp added a comment. This revision is now accepted and ready to land. LGTM, thanks for fixing! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158486/new/ https://reviews.llvm.org/D158486 _

[PATCH] D159436: [clang-tidy] Add support for optional parameters in config.

2023-09-05 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. Thanks for the patch! I must admit I don't fully understand what problem it solves, i.e. parameters are already optional today (one just simply doesn't specify them in the config file). Why would we want to explicitly spell out parameters with some default value t

[PATCH] D159436: [clang-tidy] Add support for optional parameters in config.

2023-09-05 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added inline comments. Comment at: clang-tools-extra/test/clang-tidy/infrastructure/optional-parameter.cpp:18 +// RUN: -config='{CheckOptions: { \ +// RUN: bugprone-easily-swappable-parameters.MinimumLength: "false", \ +// RUN: }}' -- What i

[PATCH] D137340: [clang-tidy] Add misc-use-anonymous-namespace check

2022-11-24 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. Another week, another ping @njames93 @aaron.ballman I have addressed all comments since 3 weeks ago, and have not received any objections. I intend to land this patch next week (1st December) if I don't receive any further feedback. Repository: rG LLVM Github

[PATCH] D137205: [clang-tidy] Add performance-unnecessary-copy-on-last-use check

2022-11-28 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. > by design clang-format only performs white-space changes clang-format does support east/west const enforcement with the `QualifierAlignment` option. From experience, I strongly encourage repo owners to enable it repo-wide to avoid these kinds of discussions. Unt

[PATCH] D137205: [clang-tidy] Add performance-unnecessary-copy-on-last-use check

2022-11-28 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. > we can't rehash the discussion here because it's too big Indeed, it's a major task to undertake so I don't mean to hijack this thread with that :) Just wanted to point out clang-format supports it in case it's of interest (it's a fairly new addition that not eve

[PATCH] D137340: [clang-tidy] Add misc-use-anonymous-namespace check

2022-11-29 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp updated this revision to Diff 478603. carlosgalvezp added a comment. Replace "the" anonymous namespace with "an" anonymous namespace Rebase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137340/new/ https://reviews.llvm.org/D137340 F

[PATCH] D137340: [clang-tidy] Add misc-use-anonymous-namespace check

2022-11-30 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp marked an inline comment as done. carlosgalvezp added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/misc/use-anonymous-namespace.rst:7-9 +that could instead be moved into an anonymous namespace. It also detects +instances moved to an anonymo

[PATCH] D137340: [clang-tidy] Add misc-use-anonymous-namespace check

2022-11-30 Thread Carlos Galvez via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. carlosgalvezp marked an inline comment as done. Closed by commit rG65d6d67fc9a9: [clang-tidy] Add misc-use-anonymous-namespace check (authored by carlosgalvezp). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACT

[PATCH] D128372: [Clang-Tidy] Empty Check

2022-11-30 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. In D128372#3957982 , @cjdb wrote: > @njames93 if you don't have any further concerns, I am going to merge this on > Friday afternoon, as it will have been four months since there has been a > maintainer's input. @cjdb I h

[PATCH] D139113: Fix a couple additional cases in misc-use-anonymous-namespace only

2022-12-01 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp created this revision. Herald added a reviewer: njames93. Herald added a project: All. carlosgalvezp requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. - Do not analyze header files, since we don't want to promote usi

[PATCH] D139113: Fix a couple additional cases in misc-use-anonymous-namespace only

2022-12-01 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp updated this revision to Diff 479284. carlosgalvezp added a comment. Fix naming convention Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139113/new/ https://reviews.llvm.org/D139113 Files: clang-tools-extra/clang-tidy/misc/UseAnony

[PATCH] D139113: Fix a couple additional cases in misc-use-anonymous-namespace only

2022-12-01 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp updated this revision to Diff 479383. carlosgalvezp added a comment. Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139113/new/ https://reviews.llvm.org/D139113 Files: clang-tools-extra/clang-tidy/misc/UseAnonymousN

[PATCH] D139113: Fix a couple additional cases in misc-use-anonymous-namespace only

2022-12-01 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp marked 2 inline comments as done. carlosgalvezp added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/UseAnonymousNamespaceCheck.cpp:44 + const SourceManager &SM = MatchedDecl->getASTContext().getSourceManager(); + if (!SM.isWrittenInMainFile(Matche

[PATCH] D139113: Fix a couple additional cases in misc-use-anonymous-namespace only

2022-12-01 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp updated this revision to Diff 479391. carlosgalvezp marked an inline comment as done. carlosgalvezp added a comment. Add options for users to define their own header file extensions. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139113

[PATCH] D139113: Fix a couple additional cases in misc-use-anonymous-namespace only

2022-12-01 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp updated this revision to Diff 479394. carlosgalvezp added a comment. Document ignored cases in the documentation. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139113/new/ https://reviews.llvm.org/D139113 Files: clang-tools-extra/c

[PATCH] D139113: Fix a couple additional cases in misc-use-anonymous-namespace only

2022-12-01 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp updated this revision to Diff 479397. carlosgalvezp added a comment. Remove accidentally added newline. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139113/new/ https://reviews.llvm.org/D139113 Files: clang-tools-extra/clang-tidy/

[PATCH] D139113: Fix a couple additional cases in misc-use-anonymous-namespace only

2022-12-01 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. I'm happy with my changes now, ready for a new round of review! :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139113/new/ https://reviews.llvm.org/D139113 ___ cfe-commit

[PATCH] D139113: Fix a couple additional cases in misc-use-anonymous-namespace only

2022-12-01 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp updated this revision to Diff 479403. carlosgalvezp added a comment. Fix typo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139113/new/ https://reviews.llvm.org/D139113 Files: clang-tools-extra/clang-tidy/misc/UseAnonymousNamespace

[PATCH] D139113: Fix a couple additional cases in misc-use-anonymous-namespace only

2022-12-01 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp marked an inline comment as done. carlosgalvezp added a comment. > The LLVM coding style says to prefer static over anonymous namespaces. Yes, but this is not an LLVM check, it's a `misc` check. Other project are allowed to have other guidelines. Repository: rG LLVM Github Mono

[PATCH] D139113: Fix a couple additional cases in misc-use-anonymous-namespace

2022-12-01 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp updated this revision to Diff 479409. carlosgalvezp retitled this revision from "Fix a couple additional cases in misc-use-anonymous-namespace only" to "Fix a couple additional cases in misc-use-anonymous-namespace". carlosgalvezp edited the summary of this revision. carlosgalvezp a

[PATCH] D139197: Do not warn about redundant static in misc-use-anonymous-namespace

2022-12-02 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp created this revision. Herald added a reviewer: njames93. Herald added a project: All. carlosgalvezp requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. I will create a new check "readability-redundant-static" where th

[PATCH] D139197: Do not warn about redundant static in misc-use-anonymous-namespace

2022-12-02 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp updated this revision to Diff 479616. carlosgalvezp added a comment. Reorder matchers to reduce diff. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139197/new/ https://reviews.llvm.org/D139197 Files: clang-tools-extra/clang-tidy/mi

[PATCH] D139197: Do not warn about redundant static in misc-use-anonymous-namespace

2022-12-02 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. In D139197#3966549 , @lebedev.ri wrote: > This patch should not land before that one does. The original code is 1 day old. Do we really need to be so strict? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTI

[PATCH] D139197: Do not warn about redundant static in misc-use-anonymous-namespace

2022-12-02 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. My plan was to apply this removal in the same patch where I add the new check, but I know I'd get comments like "please do the removal in a separate patch". So that's what I'm doing :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://rev

[PATCH] D139197: Do not warn about redundant static in misc-use-anonymous-namespace

2022-12-02 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. Ah, then it has the exact same functionality! My idea for readability-redundant-static was to warn about: - static in anonymous namespace - static const/constexpr at global scope (since const gives implicit internal linkage in C++). I will see what I can do about

[PATCH] D139197: [clang-tidy] Do not warn about redundant static in misc-use-anonymous-namespace

2022-12-02 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp updated this revision to Diff 479651. carlosgalvezp edited the summary of this revision. carlosgalvezp added a comment. Update commit message. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139197/new/ https://reviews.llvm.org/D139197

[PATCH] D139197: [clang-tidy] Do not warn about redundant static in misc-use-anonymous-namespace

2022-12-02 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp updated this revision to Diff 479656. carlosgalvezp added a comment. Simplify anonymous namespace matcher. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139197/new/ https://reviews.llvm.org/D139197 Files: clang-tools-extra/clang-ti

[PATCH] D144912: [clang-tidy] readability-identifier-naming: fix hungarian enum prefix in C

2023-03-18 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. Looks good but I fail to understand what exactly the patch fixes, can you point me to an example in the tests? It would be easier to review if the NFC changes had been done in a separate patch. Comment at: clang-tools-extra/test/clang-tidy/chec

[PATCH] D145617: [clang-tidy] Add readability-avoid-unconditional-preprocessor-if check

2023-03-18 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. Looks good, minor comments! Comment at: clang-tools-extra/clang-tidy/readability/AvoidUnconditionalPreprocessorIfCheck.h:16 + +/// Check flags always enabled or disabled code blocks in preprocessor `#if` +/// conditions, such as `#if 0` and `#i

[PATCH] D144522: [clang-tidy] Add readability-operators-representation check

2023-03-18 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/readability/operators-representation.rst:16 +To configure the check to enforce the traditional token representation, you can +set the `BinaryOperators` and `OverloadedOperators` options to

[PATCH] D144912: [clang-tidy] readability-identifier-naming: fix hungarian enum prefix in C

2023-03-18 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp accepted this revision. carlosgalvezp added a comment. This revision is now accepted and ready to land. > Without this patch, the suggested fix in a C file by clang-tidy is iRevValid > instead of rtRevValid. Ah there it was, thanks for the clarification! It was not highlighted in t

[PATCH] D144522: [clang-tidy] Add readability-operators-representation check

2023-03-18 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/readability/operators-representation.rst:28-29 + +Alternative Token Representation + + carlosgalvezp wrote: > Personally I find this to be a

[PATCH] D145617: [clang-tidy] Add readability-avoid-unconditional-preprocessor-if check

2023-03-18 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/AvoidUnconditionalPreprocessorIfCheck.cpp:41 + + bool isStatic(SourceManager &SM, const LangOptions &LangOpts, +SourceRange ConditionRange) { "static" is a

[PATCH] D144522: [clang-tidy] Add readability-operators-representation check

2023-03-19 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/readability/operators-representation.rst:16 +To configure the check to enforce the traditional token representation, you can +set the `BinaryOperators` and `OverloadedOperators` options to

[PATCH] D146653: [clang-tidy][NFC] Move avoid-underscore-in-googletest-name to google folder

2023-03-22 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp created this revision. Herald added subscribers: PiotrZSL, xazax.hun. Herald added a project: All. carlosgalvezp requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Since the check belongs to the google module, it make

[PATCH] D146655: [clang-tidy] Ignore more DISABLED_ in google-avoid-underscore-in-googletest-name

2023-03-22 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp created this revision. Herald added subscribers: PiotrZSL, xazax.hun. Herald added a reviewer: njames93. Herald added a project: All. carlosgalvezp requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Test suite name ca

[PATCH] D146653: [clang-tidy][NFC] Move avoid-underscore-in-googletest-name to google folder

2023-03-22 Thread Carlos Galvez via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG7e5c48b8bd9f: [clang-tidy][NFC] Move avoid-underscore-in-googletest-name to google folder (authored by carlosgalvezp). Changed prior to commit: h

[PATCH] D146655: [clang-tidy] Ignore more DISABLED_ in google-avoid-underscore-in-googletest-name

2023-03-22 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp updated this revision to Diff 507458. carlosgalvezp added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146655/new/ https://reviews.llvm.org/D146655 Files: clang-tools-extra/clang-tidy/google/AvoidUnderscoreInGoog

[PATCH] D146655: [clang-tidy] Ignore more DISABLED_ in google-avoid-underscore-in-googletest-name

2023-03-22 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp updated this revision to Diff 507464. carlosgalvezp added a comment. Add to release notes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146655/new/ https://reviews.llvm.org/D146655 Files: clang-tools-extra/clang-tidy/google/AvoidU

[PATCH] D146655: [clang-tidy] Ignore DISABLED_ in test suite name in google-avoid-underscore-in-googletest-name

2023-03-22 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp updated this revision to Diff 507465. carlosgalvezp retitled this revision from "[clang-tidy] Ignore more DISABLED_ in google-avoid-underscore-in-googletest-name" to "[clang-tidy] Ignore DISABLED_ in test suite name in google-avoid-underscore-in-googletest-name". carlosgalvezp added

[PATCH] D146655: [clang-tidy] Ignore DISABLED_ in test suite name in google-avoid-underscore-in-googletest-name

2023-03-22 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp updated this revision to Diff 507467. carlosgalvezp added a comment. Remove excessive newline Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146655/new/ https://reviews.llvm.org/D146655 Files: clang-tools-extra/clang-tidy/google/Avo

[PATCH] D146655: [clang-tidy] Ignore DISABLED_ in test suite name in google-avoid-underscore-in-googletest-name

2023-03-23 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:237 +- Fixed an issue in :doc:`google-avoid-underscore-in-googletest-name + ` when using Eugene.Zelenko wrote: > Please keep alphabetical order (by check name) in this sec

[PATCH] D146655: [clang-tidy] Ignore DISABLED_ in test suite name in google-avoid-underscore-in-googletest-name

2023-03-23 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:237 +- Fixed an issue in :doc:`google-avoid-underscore-in-googletest-name + ` when using PiotrZSL wrote: > carlosgalvezp wrote: > > Eugene.Zelenko wrote: > > > Please keep

[PATCH] D146655: [clang-tidy] Ignore DISABLED_ in test suite name in google-avoid-underscore-in-googletest-name

2023-03-23 Thread Carlos Galvez via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb08d35f826a6: [clang-tidy] Ignore DISABLED_ in test suite name in google-avoid-underscore-in… (authored by carlosgalvezp). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[PATCH] D146713: [clang-tidy][NFC] Improve naming convention in google-readability-avoid-underscore-in-googletest-name

2023-03-23 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp created this revision. Herald added subscribers: PiotrZSL, xazax.hun. Herald added a reviewer: njames93. Herald added a project: All. carlosgalvezp requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. According to the G

[PATCH] D146713: [clang-tidy][NFC] Improve naming convention in google-readability-avoid-underscore-in-googletest-name

2023-03-23 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp updated this revision to Diff 507767. carlosgalvezp added a comment. Fix missing naming convention in the test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146713/new/ https://reviews.llvm.org/D146713 Files: clang-tools-extra/cla

[PATCH] D146713: [clang-tidy][NFC] Improve naming convention in google-readability-avoid-underscore-in-googletest-name

2023-03-23 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp marked an inline comment as done. carlosgalvezp added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/google/avoid-underscore-in-googletest-name.cpp:10 TEST(TestCaseName, Illegal_TestName) {} // CHECK-MESSAGES: :[[@LINE-1]]:20: warning:

[PATCH] D146655: [clang-tidy] Ignore DISABLED_ in test suite name in google-avoid-underscore-in-googletest-name

2023-03-23 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:237 +- Fixed an issue in :doc:`google-avoid-underscore-in-googletest-name + ` when using Eugene.Zelenko wrote: > Eugene.Zelenko wrote: > > carlosgalvezp wrote: > > > Piotr

[PATCH] D146713: [clang-tidy][NFC] Improve naming convention in google-readability-avoid-underscore-in-googletest-name

2023-03-24 Thread Carlos Galvez via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. carlosgalvezp marked an inline comment as done. Closed by commit rGf957b8fe1efe: [clang-tidy][NFC] Improve naming convention in google-readability-avoid… (authored by carlosgalvezp). Repository: rG LLVM Github Monorepo C

[PATCH] D146655: [clang-tidy] Ignore DISABLED_ in test suite name in google-avoid-underscore-in-googletest-name

2023-03-24 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:237 +- Fixed an issue in :doc:`google-avoid-underscore-in-googletest-name + ` when using Eugene.Zelenko wrote: > carlosgalvezp wrote: > > Eugene.Zelenko wrote: > > > Eugen

[PATCH] D144522: [clang-tidy] Add readability-operators-representation check

2023-03-25 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. Looks really good, thank you! I have only very minor comments, mostly style nits and suggestions for improved readability. Comment at: clang-tools-extra/clang-tidy/readability/OperatorsRepresentationCheck.cpp:25 + +StringRef getOperatorSpelling(

[PATCH] D145617: [clang-tidy] Add readability-avoid-unconditional-preprocessor-if check

2023-03-25 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp accepted this revision. carlosgalvezp added a comment. This revision is now accepted and ready to land. LGTM thank you! Really useful check! I'm not very expert in the PP callbacks so I can't give much feedback, feel free to wait for other more expert reviewers if you want. Repos

[PATCH] D145617: [clang-tidy] Add readability-avoid-unconditional-preprocessor-if check

2023-03-25 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp requested changes to this revision. carlosgalvezp added a comment. This revision now requires changes to proceed. I noticed the pre-merge checks are red, however, would be good to get them fixed. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D146520: [clang-tidy] Fix checks filter with warnings-as-errors

2023-03-25 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. I'm not sure I follow - if you enable warnings as error for all checks, then the expectation is that you indeed get an error if you violate one of the clang-analyzer checks. In what way is this not wanted? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D146520: [clang-tidy] Fix checks filter with warnings-as-errors

2023-03-25 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. Also, regarding clang-analyzer-core checks, I have 2 tickets open: https://github.com/llvm/llvm-project/issues/59588 https://github.com/llvm/llvm-project/issues/59589 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1465

[PATCH] D146520: [clang-tidy] Fix checks filter with warnings-as-errors

2023-03-25 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. Reading through Github I found the associated ticket (it would be good if you could mention it in the commit message): https://github.com/llvm/llvm-project/issues/61520 So if I understand correctly, what you are trying to do is continue to let the clang-analyzer-c

[PATCH] D143971: [clang-tidy] Flag more buggy string constructor cases

2023-03-25 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone/string-constructor.rst:25 + std::string str(buf[1], 5); // First arg should be '&buf[1]'? + std::string str2((int)buf[1], 5); // Ok - explicitly cast to express intent

[PATCH] D146913: [clang-tidy] Add option to ignore user-defined literals in readability-magic-numbers

2023-03-26 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp created this revision. Herald added subscribers: PiotrZSL, xazax.hun. Herald added a reviewer: njames93. Herald added a project: All. carlosgalvezp requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Some user-defined

[PATCH] D145617: [clang-tidy] Add readability-avoid-unconditional-preprocessor-if check

2023-03-26 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. In D145617#4221369 , @PiotrZSL wrote: > @carlosgalvezp Do you want me to shorten documentation ? Or we leave it like > it is ? It's fine for me either way! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D145617: [clang-tidy] Add readability-avoid-unconditional-preprocessor-if check

2023-03-26 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp accepted this revision. carlosgalvezp added a comment. This revision is now accepted and ready to land. LGTM, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145617/new/ https://reviews.llvm.org/D145617

[PATCH] D146913: [clang-tidy] Add option to ignore user-defined literals in readability-magic-numbers

2023-03-26 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp updated this revision to Diff 508410. carlosgalvezp added a comment. Move implementation to .cpp file. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146913/new/ https://reviews.llvm.org/D146913 Files: clang-tools-extra/clang-tidy/r

[PATCH] D146913: [clang-tidy] Add option to ignore user-defined literals in readability-magic-numbers

2023-03-26 Thread Carlos Galvez via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG556600af6a8a: [clang-tidy] Add option to ignore user-defined literals in readability-magic… (authored by carlosgalvezp). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.

[PATCH] D147062: [clang-tidy] Add option to ignore capture default by reference in cppcoreguidelines-avoid-capture-default-when-capturing-this

2023-03-28 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp created this revision. Herald added subscribers: PiotrZSL, shchenz, kbarton, xazax.hun, nemanjai. Herald added a reviewer: njames93. Herald added a project: All. carlosgalvezp requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-

[PATCH] D147062: [clang-tidy] Add option to ignore capture default by reference in cppcoreguidelines-avoid-capture-default-when-capturing-this

2023-03-28 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp updated this revision to Diff 509061. carlosgalvezp added a comment. Clean up check suffix in test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147062/new/ https://reviews.llvm.org/D147062 Files: clang-tools-extra/clang-tidy/cpp

<    1   2   3   4   5   6   7   8   9   >