No output with clang-tidy v15
mirenradia opened this issue · comments
Pretty much as in the title.
When I set version: 15
for this action, I get no output e.g. this is what I see in the job output:
Performing checkup on Examples/BinaryBH/BinaryBHLevel.cpp
INFO:CPP Linter:Running "clang-tidy-15 --export-fixes=.cpp-linter_cache/clang_tidy_output.yml --extra-arg=-g --extra-arg=-O3 --extra-arg=-Wno-c++17-extensions --extra-arg=-std=c++17 --extra-arg=-pthread --extra-arg=-DBL_USE_MPI --extra-arg=-DAMREX_USE_MPI --extra-arg=-DBL_NO_FORT --extra-arg=-DAMREX_GPU_MAX_THREADS=0 --extra-arg=-DBL_SPACEDIM=3 --extra-arg=-DAMREX_SPACEDIM=3 --extra-arg=-DBL_FORT_USE_UNDERSCORE --extra-arg=-DAMREX_FORT_USE_UNDERSCORE --extra-arg=-DBL_Linux --extra-arg=-DAMREX_Linux --extra-arg=-DNDEBUG --extra-arg=-DAMREX_NO_PROBINIT --extra-arg=-DOMPI_SKIP_MPICXX --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/tmp_build_dir/s/3d.llvm.MPI.EXE --extra-arg=-I. --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/amrex/Src/Base --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/amrex/Src/Base/Parser --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/amrex/Src/Boundary --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/amrex/Src/AmrCore --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/amrex/Src/Amr --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/Examples/BinaryBH --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/Source/utils --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/Source/simd --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/Source/CCZ4 --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/Source/BoxUtils --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/Source/GRAMReXCore --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/Source/AMRInterpolator --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/Source/TaggingCriteria --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/Source/InitialConditions/BlackHoles --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/Source/BlackHoles Examples/BinaryBH/BinaryBHLevel.cpp"
DEBUG:CPP Linter:Output from clang-tidy:
When I set version: 14
(or 12
), I get the expected output:
INFO:CPP Linter:Running "clang-tidy-14 --export-fixes=.cpp-linter_cache/clang_tidy_output.yml --extra-arg=-g --extra-arg=-O3 --extra-arg=-Wno-c++17-extensions --extra-arg=-std=c++17 --extra-arg=-pthread --extra-arg=-DBL_USE_MPI --extra-arg=-DAMREX_USE_MPI --extra-arg=-DBL_NO_FORT --extra-arg=-DAMREX_GPU_MAX_THREADS=0 --extra-arg=-DBL_SPACEDIM=3 --extra-arg=-DAMREX_SPACEDIM=3 --extra-arg=-DBL_FORT_USE_UNDERSCORE --extra-arg=-DAMREX_FORT_USE_UNDERSCORE --extra-arg=-DBL_Linux --extra-arg=-DAMREX_Linux --extra-arg=-DNDEBUG --extra-arg=-DAMREX_NO_PROBINIT --extra-arg=-DOMPI_SKIP_MPICXX --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/tmp_build_dir/s/3d.llvm.MPI.EXE --extra-arg=-I. --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/amrex/Src/Base --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/amrex/Src/Base/Parser --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/amrex/Src/Boundary --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/amrex/Src/AmrCore --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/amrex/Src/Amr --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/Examples/BinaryBH --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/Source/utils --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/Source/simd --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/Source/CCZ4 --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/Source/BoxUtils --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/Source/GRAMReXCore --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/Source/AMRInterpolator --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/Source/TaggingCriteria --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/Source/InitialConditions/BlackHoles --extra-arg=-I/home/runner/work/GRAMReX/GRAMReX/Source/BlackHoles Examples/BinaryBH/BinaryBHLevel.cpp"
DEBUG:CPP Linter:Output from clang-tidy:
/home/runner/work/GRAMReX/GRAMReX/Examples/BinaryBH/BinaryBHLevel.cpp:26:45: warning: 4 adjacent parameters of 'operator()' of similar type ('int') are easily swapped by mistake [bugprone-easily-swappable-parameters]
[=] AMREX_GPU_DEVICE(int box_no, int i, int j, int k)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<long list of other warnings>
- What OS are you using? It seems like ubuntu, but is it the latest (currently
22.04
) or specifically20.04
? - What config are you using for cpp-linter?
A little more detail would go a long way for reproducing the issue (& developing a solution). If the repo is public, then you can share a link...
Sorry about the vagueness. Unfortunately the repo isn't public but the action is as follows:
name: Lint
on: [push]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
clang-tidy:
name: clang-tidy
runs-on: ubuntu-22.04
env:
AMREX_HOME: ${{ github.workspace }}/amrex
BINARYBH_EXAMPLE_DIR: ${{ github.workspace }}/Examples/BinaryBH
TMP_BUILD_DIR: ${{ github.workspace }}/tmp_build_dir
steps:
- name: Checkout GRAMReX
uses: actions/checkout@v3
with:
clean: false
- name: Checkout AMReX
uses: actions/checkout@v3
with:
repository: AMReX-Codes/amrex
path: amrex
clean: false
- name: Update package manager database
id: update-database
continue-on-error: true
run: sudo apt-get update
# This is quite slow so only do this if the previous command fails
- name: Update package repository mirrors if necessary
if: steps.update-database.outcome == 'failure'
run: |
sudo gem install apt-spy2
sudo apt-spy2 fix --commit --launchpad --country=US
sudo apt-get update
- name: Install MPICH
run: sudo apt-get -y --no-install-recommends install libmpich-dev
- name: Generate config and Determine compiler flags
id: flags
run: |
make COMP=llvm AMReX_Config.H
echo "mpiflags=$(MPICH_CXX=clang++ mpicxx -compile_info | sed 's/^[^\s]*\ //')" >> $GITHUB_OUTPUT
echo "cxxflags=$(make print-CXXFLAGS COMP=llvm | tail -n 3 | head -n 1 | sed 's/^.*\ is\ //')" >> $GITHUB_OUTPUT
echo "cppflags=$(make print-CPPFLAGS COMP=llvm | tail -n 3 | head -n 1 | sed 's/^.*\ is\ //')" >> $GITHUB_OUTPUT
echo "includes=$(make print-includes COMP=llvm | tail -n 3 | head -n 1 | sed 's/^.*\ is\ //')" >> $GITHUB_OUTPUT
working-directory: ${{ env.BINARYBH_EXAMPLE_DIR }}
- name: Run clang-tidy on diff
uses: cpp-linter/cpp-linter-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: ''
tidy-checks: ''
version: 15
files-changed-only: true
extra-args: ${{ join(steps.flags.outputs.*,' ') }}
The .clang-tidy
config file at the repository root is
---
Checks: >
'clang-diagnostic-*,
clang-analyzer-*,
bugprone-*,
cppcoreguidelines-*,
-cppcoreguidelines-no-malloc,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-non-private-member-variables-in-classes,
modernize-*,
-modernize-use-trailing-return-type,
mpi-*,
performance-*,
readability-*,
-readability-magic-numbers,
-readability-avoid-const-params-in-decls'
WarningsAsErrors: ''
HeaderFilterRegex: '.*\.hpp'
FormatStyle: none
CheckOptions:
- key: modernize-replace-auto-ptr.IncludeStyle
value: llvm
- key: cppcoreguidelines-no-malloc.Reallocations
value: '::realloc'
- key: cppcoreguidelines-owning-memory.LegacyResourceConsumers
value: '::free;::realloc;::freopen;::fclose'
- key: readability-static-accessed-through-instance.NameSpecifierNestingThreshold
value: '3'
- key: readability-function-size.VariableThreshold
value: '4294967295'
- key: modernize-use-auto.MinTypeNameLength
value: '5'
- key: bugprone-reserved-identifier.Invert
value: 'false'
- key: performance-move-const-arg.CheckTriviallyCopyableMove
value: 'true'
- key: cert-dcl16-c.NewSuffixes
value: 'L;LL;LU;LLU'
- key: bugprone-narrowing-conversions.WarnOnFloatingPointNarrowingConversion
value: 'true'
- key: readability-identifier-naming.GetConfigPerFile
value: 'true'
- key: bugprone-narrowing-conversions.PedanticMode
value: 'false'
- key: readability-inconsistent-declaration-parameter-name.Strict
value: 'false'
- key: cppcoreguidelines-macro-usage.CheckCapsOnly
value: 'false'
- key: bugprone-unused-return-value.CheckedFunctions
value: '::std::async;::std::launder;::std::remove;::std::remove_if;::std::unique;::std::unique_ptr::release;::std::basic_string::empty;::std::vector::empty;::std::back_inserter;::std::distance;::std::find;::std::find_if;::std::inserter;::std::lower_bound;::std::make_pair;::std::map::count;::std::map::find;::std::map::lower_bound;::std::multimap::equal_range;::std::multimap::upper_bound;::std::set::count;::std::set::find;::std::setfill;::std::setprecision;::std::setw;::std::upper_bound;::std::vector::at;::bsearch;::ferror;::feof;::isalnum;::isalpha;::isblank;::iscntrl;::isdigit;::isgraph;::islower;::isprint;::ispunct;::isspace;::isupper;::iswalnum;::iswprint;::iswspace;::isxdigit;::memchr;::memcmp;::strcmp;::strcoll;::strncmp;::strpbrk;::strrchr;::strspn;::strstr;::wcscmp;::access;::bind;::connect;::difftime;::dlsym;::fnmatch;::getaddrinfo;::getopt;::htonl;::htons;::iconv_open;::inet_addr;::isascii;::isatty;::mmap;::newlocale;::openat;::pathconf;::pthread_equal;::pthread_getspecific;::pthread_mutex_trylock;::readdir;::readlink;::recvmsg;::regexec;::scandir;::semget;::setjmp;::shm_open;::shmget;::sigismember;::strcasecmp;::strsignal;::ttyname'
- key: modernize-use-default-member-init.UseAssignment
value: 'false'
- key: readability-function-size.NestingThreshold
value: '4294967295'
- key: modernize-use-override.AllowOverrideAndFinal
value: 'false'
- key: readability-function-size.ParameterThreshold
value: '4294967295'
- key: modernize-pass-by-value.ValuesOnly
value: 'false'
- key: modernize-loop-convert.IncludeStyle
value: llvm
- key: cert-str34-c.DiagnoseSignedUnsignedCharComparisons
value: '0'
- key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison
value: 'false'
- key: cppcoreguidelines-explicit-virtual-functions.AllowOverrideAndFinal
value: 'false'
- key: readability-redundant-smartptr-get.IgnoreMacros
value: 'true'
- key: readability-identifier-naming.AggressiveDependentMemberLookup
value: 'false'
- key: bugprone-suspicious-string-compare.WarnOnImplicitComparison
value: 'true'
- key: modernize-use-emplace.TupleTypes
value: '::std::pair;::std::tuple'
- key: modernize-use-emplace.TupleMakeFunctions
value: '::std::make_pair;::std::make_tuple'
- key: cppcoreguidelines-owning-memory.LegacyResourceProducers
value: '::malloc;::aligned_alloc;::realloc;::calloc;::fopen;::freopen;::tmpfile'
- key: bugprone-argument-comment.CommentNullPtrs
value: '0'
- key: bugprone-argument-comment.StrictMode
value: '0'
- key: cppcoreguidelines-init-variables.IncludeStyle
value: llvm
- key: modernize-use-nodiscard.ReplacementString
value: '[[nodiscard]]'
- key: modernize-loop-convert.MakeReverseRangeHeader
value: ''
- key: modernize-replace-random-shuffle.IncludeStyle
value: llvm
- key: cppcoreguidelines-narrowing-conversions.WarnOnFloatingPointNarrowingConversion
value: 'true'
- key: modernize-use-bool-literals.IgnoreMacros
value: 'true'
- key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField
value: 'true'
- key: google-readability-namespace-comments.ShortNamespaceLines
value: '10'
- key: bugprone-suspicious-string-compare.StringCompareLikeFunctions
value: ''
- key: modernize-avoid-bind.PermissiveParameterList
value: 'false'
- key: modernize-use-override.FinalSpelling
value: final
- key: performance-move-constructor-init.IncludeStyle
value: llvm
- key: modernize-loop-convert.UseCxx20ReverseRanges
value: 'true'
- key: modernize-use-noexcept.ReplacementString
value: ''
- key: modernize-use-using.IgnoreMacros
value: 'true'
- key: performance-type-promotion-in-math-fn.IncludeStyle
value: llvm
- key: cppcoreguidelines-explicit-virtual-functions.FinalSpelling
value: final
- key: modernize-loop-convert.NamingStyle
value: CamelCase
- key: bugprone-suspicious-include.ImplementationFileExtensions
value: 'c;cc;cpp;cxx'
- key: cppcoreguidelines-pro-type-member-init.UseAssignment
value: 'false'
- key: modernize-loop-convert.MakeReverseRangeFunction
value: ''
- key: bugprone-suspicious-include.HeaderFileExtensions
value: ';h;hh;hpp;hxx'
- key: performance-no-automatic-move.AllowedTypes
value: ''
- key: performance-for-range-copy.WarnOnAllAutoCopies
value: 'false'
- key: bugprone-argument-comment.CommentIntegerLiterals
value: '0'
- key: bugprone-suspicious-missing-comma.SizeThreshold
value: '5'
- key: readability-inconsistent-declaration-parameter-name.IgnoreMacros
value: 'true'
- key: readability-identifier-naming.IgnoreFailedSplit
value: 'false'
- key: modernize-pass-by-value.IncludeStyle
value: llvm
- key: bugprone-sizeof-expression.WarnOnSizeOfThis
value: 'true'
- key: readability-qualified-auto.AddConstToQualified
value: 'true'
- key: bugprone-string-constructor.WarnOnLargeLength
value: 'true'
- key: bugprone-too-small-loop-variable.MagnitudeBitsUpperLimit
value: '16'
- key: readability-simplify-boolean-expr.ChainedConditionalReturn
value: 'false'
- key: cppcoreguidelines-explicit-virtual-functions.OverrideSpelling
value: override
- key: readability-else-after-return.WarnOnConditionVariables
value: 'true'
- key: readability-uppercase-literal-suffix.IgnoreMacros
value: 'true'
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
- key: modernize-make-shared.IgnoreMacros
value: 'true'
- key: bugprone-dynamic-static-initializers.HeaderFileExtensions
value: ';h;hh;hpp;hxx'
- key: bugprone-suspicious-enum-usage.StrictMode
value: 'false'
- key: performance-unnecessary-copy-initialization.AllowedTypes
value: ''
- key: bugprone-suspicious-missing-comma.MaxConcatenatedTokens
value: '5'
- key: modernize-use-transparent-functors.SafeMode
value: 'false'
- key: cppcoreguidelines-macro-usage.AllowedRegexp
value: '^DEBUG_*'
- key: modernize-make-shared.IgnoreDefaultInitialization
value: 'true'
- key: bugprone-argument-comment.CommentCharacterLiterals
value: '0'
- key: cppcoreguidelines-narrowing-conversions.PedanticMode
value: 'false'
- key: bugprone-not-null-terminated-result.WantToUseSafeFunctions
value: 'true'
- key: modernize-make-shared.IncludeStyle
value: llvm
- key: bugprone-string-constructor.LargeLengthThreshold
value: '8388608'
- key: readability-simplify-boolean-expr.ChainedConditionalAssignment
value: 'false'
- key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctions
value: 'false'
- key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
value: '0'
- key: bugprone-exception-escape.FunctionsThatShouldNotThrow
value: ''
- key: bugprone-signed-char-misuse.CharTypdefsToIgnore
value: ''
- key: performance-inefficient-vector-operation.EnableProto
value: 'false'
- key: modernize-loop-convert.MaxCopySize
value: '16'
- key: bugprone-argument-comment.CommentFloatLiterals
value: '0'
- key: readability-function-size.LineThreshold
value: '4294967295'
- key: bugprone-argument-comment.CommentStringLiterals
value: '0'
- key: modernize-make-shared.MakeSmartPtrFunction
value: 'std::make_shared'
- key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors
value: 'true'
- key: modernize-make-unique.IgnoreMacros
value: 'true'
- key: performance-for-range-copy.AllowedTypes
value: ''
- key: modernize-make-shared.MakeSmartPtrFunctionHeader
value: '<memory>'
- key: modernize-use-override.IgnoreDestructors
value: 'false'
- key: bugprone-sizeof-expression.WarnOnSizeOfConstant
value: 'true'
- key: readability-redundant-string-init.StringNames
value: '::std::basic_string_view;::std::basic_string'
- key: modernize-make-unique.IgnoreDefaultInitialization
value: 'true'
- key: modernize-use-emplace.ContainersWithPushBack
value: '::std::vector;::std::list;::std::deque'
- key: modernize-make-unique.IncludeStyle
value: llvm
- key: readability-braces-around-statements.ShortStatementLines
value: '0'
- key: bugprone-argument-comment.CommentUserDefinedLiterals
value: '0'
- key: bugprone-argument-comment.CommentBoolLiterals
value: '0'
- key: modernize-use-override.OverrideSpelling
value: override
- key: performance-inefficient-string-concatenation.StrictMode
value: 'false'
- key: readability-implicit-bool-conversion.AllowPointerConditions
value: 'false'
- key: readability-redundant-declaration.IgnoreMacros
value: 'true'
- key: google-readability-braces-around-statements.ShortStatementLines
value: '1'
- key: modernize-make-unique.MakeSmartPtrFunction
value: 'std::make_unique'
- key: cppcoreguidelines-pro-type-member-init.IgnoreArrays
value: 'false'
- key: readability-else-after-return.WarnOnUnfixable
value: 'true'
- key: bugprone-reserved-identifier.AllowedIdentifiers
value: ''
- key: modernize-use-emplace.IgnoreImplicitConstructors
value: 'false'
- key: modernize-make-unique.MakeSmartPtrFunctionHeader
value: '<memory>'
- key: cppcoreguidelines-macro-usage.IgnoreCommandLineMacros
value: 'true'
- key: modernize-use-equals-delete.IgnoreMacros
value: 'true'
- key: bugprone-misplaced-widening-cast.CheckImplicitCasts
value: 'false'
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnorePublicMemberVariables
value: 'false'
- key: modernize-loop-convert.MinConfidence
value: reasonable
- key: performance-unnecessary-value-param.AllowedTypes
value: ''
- key: bugprone-suspicious-missing-comma.RatioThreshold
value: '0.200000'
- key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctionsWhenCopyIsDeleted
value: 'false'
- key: readability-uppercase-literal-suffix.NewSuffixes
value: ''
- key: google-readability-namespace-comments.SpacesBeforeComments
value: '2'
- key: readability-function-cognitive-complexity.Threshold
value: '25'
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
and I've also tried omitting the tidy-checks
argument in the action so that the default checks are used.
Note that there is no compilation database but passing the flags to the extra-args
argument seems to work fine for versions 12 and 14.
Thanks!
Just to be sure this isn't a problem with clang-tidy-15: If you run clang-tidy-15 locally, do you get the expected output?
Yes, I use v15.0.7 on my local system (running Fedora 37).
Thanks, I'll start looking into this tomorrow.
It seems this is because clang-tools still download binary instead of using existing native binary.
gitpod /workspace/clang-tools-pip (main) $ clang-tools -i 15 -b
Found a installed version of clang-format: 15.0.7 at /usr/lib/llvm-15/bin/clang-format
downloading clang-format (version 15)
Installing clang-format-15 to /home/gitpod/.local/bin/
symbolic link created /home/gitpod/.local/bin/clang-format
Found a installed version of clang-tidy: 15.0.7 at /usr/lib/llvm-15/bin/clang-tidy
downloading clang-tidy (version 15)
Installing clang-tidy-15 to /home/gitpod/.local/bin/
symbolic link created /home/gitpod/.local/bin/clang-tidy
gitpod /workspace/clang-tools-pip (main) $ which clang-tidy-15
/home/gitpod/.local/bin/clang-tidy-15
gitpod /workspace/clang-tools-pip (main) $
I have reopened the cpp-linter/clang-tools-pip#37
@2bndy5 I have created a pull request for your review cpp-linter/clang-tools-pip#43
It seems this is because clang-tools still download binary instead of using existing native binary.
Is the downloaded clang-tidy-15 binary still suffering from a segmentation fault (as clang-tidy-14 did in the past)? If so, there should be a way to show this in the cpp-linter output, although that would depend on if the subprocess.run()
call actually uses the stderrr or stdout streams (assuming the seg fault actually produces output).
From my last test muttleyxd/clang-tools-static-binaries#18 (comment) segfault still exist and so far there is no new release address this problem. if need please log your idea of show the output to cpp-linter.
Hi @mirenradia we just released v2
and v2.4.2
to fix this issue, please let us know if this works for you or not. thank you!
Hi @mirenradia we just released
v2
andv2.4.2
to fix this issue, please let us know if this works for you or not. thank you!
Yep, it works for me now!