diff --git a/.clang-tidy b/.clang-tidy index 6291e8dff777f92e30a0cc306877e7b44a015180..fd7e8fa0e6be666e7078070a9c46cce69da8ed64 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -14,6 +14,8 @@ Checks: > -cert-msc51-cpp, -clang-diagnostic-empty-translation-unit, -clang-diagnostic-unknown-attributes, + -clang-diagnostic-vla-cxx-extension, + -performance-avoid-endl, -modernize-macro-to-enum, -readability-braces-around-statements, -readability-function-cognitive-complexity, @@ -21,6 +23,7 @@ Checks: > -readability-implicit-bool-conversion, -readability-isolate-declaration, -readability-magic-numbers, + -performance-avoid-endl, WarningsAsErrors: > bugprone-*, diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3a154d2e96564fa8d520577f3e3cbe22245e53aa..bf8e0cea3a3b7a2b9e6dd8cbe99b6e4c48eaba3f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: "flowdalic/debian-testing-dev:1.30" +image: flowdalic/gentoo-dev:20241115 cache: paths: @@ -9,10 +9,6 @@ cache: - subprojects/packagecache before_script: - - | - apt update - apt install -y libomp-${LLVM_MAJOR_VERSION}-dev - ln -sf /usr/lib/llvm-${LLVM_MAJOR_VERSION}/lib/libomp.so /usr/lib - | readarray TOOLS <<EOF c++ @@ -29,6 +25,10 @@ before_script: valgrind EOF for tool in ${TOOLS[@]}; do + if ! command -v $tool; then + echo "No $tool binary found" + continue + fi echo -n "$tool version: " $tool --version done @@ -42,9 +42,6 @@ variables: CC: gcc CXX: g++ EXTRA_NINJA_ARGS: -v - OPENCILK_DISTRIBUTION_DIR: "/opt/opencilk" - # LLVM 14 (and later) is unable to compile Mazstab. See https://github.com/llvm/llvm-project/issues/57757 - LLVM_MAJOR_VERSION: 13 stages: - smoke-test @@ -76,7 +73,6 @@ iwyu: clang-tidy: stage: smoke-test script: - - apt install -y libomp-15-dev - make tidy variables: EMPER_IO: "true" @@ -127,8 +123,8 @@ opencilk: .clang: variables: - CC: clang-${LLVM_MAJOR_VERSION} - CXX: clang++-${LLVM_MAJOR_VERSION} + CC: clang + CXX: clang++ MAZSTAB_BACKEND_EMPER_CONT_STEALING: 'false' .release-build: diff --git a/Makefile b/Makefile index 928220ea4b3fbd5fc6c7275ba6d36bec0a1c97db..0d21949a301677b4aeb04edf955c5cefaed62f41 100644 --- a/Makefile +++ b/Makefile @@ -106,6 +106,10 @@ benchmark-runner-format: tidy: compile_commands_wo_subprojects/compile_commands.json ./tools/run-clang-tidy +.PHONY: fix-tidy +fix-tidy: compile_commands_wo_subprojects/compile_commands.json + ./tools/run-clang-tidy -fix + .PHONY: iwyu iwyu: compile_commands_wo_subprojects/compile_commands.json $(NINJA) -C build $@ diff --git a/backends/emper-cont-stealing/meson.build b/backends/emper-cont-stealing/meson.build index 85337f39ddaf0dfc979656eadae9ade8bc525992..9d04c1f83b75acfeacecd58070809e5af14eb54c 100644 --- a/backends/emper-cont-stealing/meson.build +++ b/backends/emper-cont-stealing/meson.build @@ -1,7 +1,7 @@ backend_name = 'emper-cont-stealing' backend_emper_cont_stealing_option = get_option('backend-' + backend_name) -if backend_emper_cont_stealing_option and cpp_compiler_id == 'clang' +if backend_emper_cont_stealing_option and cpp_is_clang error('Can not build ' + backend_name + ' with clang') endif diff --git a/backends/openmp/meson.build b/backends/openmp/meson.build index 4e68cee9c73d7ef94d44dd087f5966901d400469..3fa9c272bfcb069171d088b6e270039a6752d335 100644 --- a/backends/openmp/meson.build +++ b/backends/openmp/meson.build @@ -20,7 +20,7 @@ foreach openmp_lib_name : openmp_lib_names openmp_cpp_args = [define_task_macro_arg] f_openmp_cpp_arg = '-fopenmp' - if cpp_compiler_id == 'clang' + if cpp_is_clang f_openmp_cpp_arg += '=lib' + openmp_lib_name endif diff --git a/benchmark-driver/benchmark-driver.cc b/benchmark-driver/benchmark-driver.cc index 07689fe862c1ab8ea608fc37df838bfc2a8ffca7..897f87af4a22e6099757359aac0007961f7353fb 100644 --- a/benchmark-driver/benchmark-driver.cc +++ b/benchmark-driver/benchmark-driver.cc @@ -83,8 +83,8 @@ static void safe_getrusage(struct rusage* rusage) { } auto do_single_benchmark_run(mzs::BenchmarkRunKind benchmark_run_kind, unsigned int iteration_id, - std::ostream& log_sink, std::ostream& csv_sink, bool& do_verify_result) - -> struct stats { + std::ostream& log_sink, std::ostream& csv_sink, + bool& do_verify_result) -> struct stats { struct rusage rusage_before, rusage_after; if (&mzs_benchmark_prepare) { diff --git a/benchmark-runner/.mill-version b/benchmark-runner/.mill-version index ddf1d4ae681d5be63653a1ac935ddc80a4570337..b80f98e66f1ad104c7e99b11be968fedf7e038b9 100644 --- a/benchmark-runner/.mill-version +++ b/benchmark-runner/.mill-version @@ -1 +1 @@ -0.10.10 +0.11.7 diff --git a/benchmark-runner/build.sc b/benchmark-runner/build.sc index 11edc82807019ce54d77448d1a607f9d17654bd4..5481c5209cb68c4f8055a60a91404e5cd0436701 100644 --- a/benchmark-runner/build.sc +++ b/benchmark-runner/build.sc @@ -1,4 +1,4 @@ -import $ivy.`com.goyeau::mill-scalafix_mill0.10:0.2.8` +import $ivy.`com.goyeau::mill-scalafix::0.3.1` import com.goyeau.mill.scalafix.ScalafixModule import mill._, scalalib._, scalafmt._ @@ -13,13 +13,13 @@ object main extends ScalaModule def mainClass = Some("de.fau.cs.mazstab.Mazstab") - def scalaVersion = "2.13.5" + def scalaVersion = "2.13.13" val smackVersion = "4.4.5" def ivyDeps = Agg( ivy"com.google.guava:guava:30.1.1-jre", ivy"com.jakewharton.picnic:picnic:0.5.0", - ivy"com.lihaoyi:::ammonite:2.3.8-124-2da846d2", + ivy"com.lihaoyi:::ammonite:3.0.0-M1", ivy"com.nrinaudo::kantan.csv-enumeratum:0.6.1", ivy"com.nrinaudo::kantan.csv-generic:0.6.1", ivy"com.nrinaudo::kantan.csv:0.6.1", @@ -49,7 +49,7 @@ object main extends ScalaModule "-Werror", ) - object test extends Tests with TestModule.ScalaTest { + object test extends ScalaTests with TestModule.ScalaTest { def ivyDeps = Agg(ivy"org.scalatest::scalatest:3.2.9") } } diff --git a/benchmark-runner/main/src/de/fau/cs/mazstab/ExperimentDescription.scala b/benchmark-runner/main/src/de/fau/cs/mazstab/ExperimentDescription.scala index c8af3f3d72e1950f720a206c3d292f93e2a00eeb..2d0057e1a7adaccc3b524f5d7f951f5a3fb6aade 100644 --- a/benchmark-runner/main/src/de/fau/cs/mazstab/ExperimentDescription.scala +++ b/benchmark-runner/main/src/de/fau/cs/mazstab/ExperimentDescription.scala @@ -41,14 +41,17 @@ object ExperimentDescription { object ExperimentDescriptionYamlProtocol extends DefaultYamlProtocol { + @annotation.nowarn("cat=other-implicit-type") implicit val benchmarkCoordinateDescriptionFormat = yamlFormat2( BenchmarkCoordinates ) + @annotation.nowarn("cat=other-implicit-type") implicit val benchmarkBinaryDescriptionFormat = yamlFormat2( PlainBenchmarkBinary ) + @annotation.nowarn("cat=other-implicit-type") implicit val experimentDescriptionFormat = yamlFormat8( ExperimentDescription.apply ) diff --git a/benchmark-runner/main/src/de/fau/cs/mazstab/MazstabConfiguration.scala b/benchmark-runner/main/src/de/fau/cs/mazstab/MazstabConfiguration.scala index fc888cead385f4d49fe5183094031ac43fb9dbc6..bfebeeff1342204ead25b0532141d87a18ca4f2a 100644 --- a/benchmark-runner/main/src/de/fau/cs/mazstab/MazstabConfiguration.scala +++ b/benchmark-runner/main/src/de/fau/cs/mazstab/MazstabConfiguration.scala @@ -68,6 +68,7 @@ case class MazstabUserConfiguration( object MazstabConfigurationYamlProtocol extends DefaultYamlProtocol { import de.fau.cs.mazstab.hooks.XmppHookUserConfigurationProtocol._ + @annotation.nowarn("cat=other-implicit-type") implicit val mazstabUserConfigurationFormat = yamlFormat4( MazstabUserConfiguration ) diff --git a/benchmark-runner/main/src/de/fau/cs/mazstab/MazstabPostProcess.scala b/benchmark-runner/main/src/de/fau/cs/mazstab/MazstabPostProcess.scala index 9978b667ca379ca87357d78195334f321a6c4a03..99ff0412a7342e2442a5ff76f7b30115f783bad4 100644 --- a/benchmark-runner/main/src/de/fau/cs/mazstab/MazstabPostProcess.scala +++ b/benchmark-runner/main/src/de/fau/cs/mazstab/MazstabPostProcess.scala @@ -5,7 +5,6 @@ package de.fau.cs.mazstab import kantan.csv._ import kantan.csv.ops._ import kantan.csv.generic._ -import kantan.csv.enumeratum._ import scala.collection._ diff --git a/benchmark-runner/main/src/de/fau/cs/mazstab/hooks/XmppHook.scala b/benchmark-runner/main/src/de/fau/cs/mazstab/hooks/XmppHook.scala index 9e88ceb5ae27a9ca7592794f5f1a9f9e29deec63..c15319e4c654299af43a066ab65f55c9b49f5b02 100644 --- a/benchmark-runner/main/src/de/fau/cs/mazstab/hooks/XmppHook.scala +++ b/benchmark-runner/main/src/de/fau/cs/mazstab/hooks/XmppHook.scala @@ -27,6 +27,7 @@ object XmppHookUserConfigurationProtocol extends DefaultYamlProtocol { } } + @annotation.nowarn("cat=other-implicit-type") implicit val xmppHookUserConfiguration = yamlFormat3( XmppHookUserConfiguration ) diff --git a/benchmark-runner/main/src/de/fau/cs/mazstab/rts/Descriptor.scala b/benchmark-runner/main/src/de/fau/cs/mazstab/rts/Descriptor.scala index 214881727b72b42c30ae02a9334dbab28fe2992f..824f59cbd96500a7281cd8d10f58ca0aa62e8b8c 100644 --- a/benchmark-runner/main/src/de/fau/cs/mazstab/rts/Descriptor.scala +++ b/benchmark-runner/main/src/de/fau/cs/mazstab/rts/Descriptor.scala @@ -30,7 +30,9 @@ object DescriptorYamlProtocol extends DefaultYamlProtocol { } } + @annotation.nowarn("cat=other-implicit-type") implicit val gitDescriptorFormat = yamlFormat2(GitDescriptor) + @annotation.nowarn("cat=other-implicit-type") implicit val mesonDescriptorFormat = yamlFormat1(MesonDescriptor) implicit object DescriptorYamlFormat extends YamlFormat[Descriptor] { diff --git a/benchmark-runner/main/src/de/fau/cs/mazstab/rts/Emper.scala b/benchmark-runner/main/src/de/fau/cs/mazstab/rts/Emper.scala index aef912ef9980cc1386c1fe50699fac24bd9652d7..54c6c8fc50cbc70a75afa667e04f5ec65e9c06f9 100644 --- a/benchmark-runner/main/src/de/fau/cs/mazstab/rts/Emper.scala +++ b/benchmark-runner/main/src/de/fau/cs/mazstab/rts/Emper.scala @@ -162,5 +162,6 @@ backends += { object EmperYamlProtocol extends DefaultYamlProtocol { import DescriptorYamlProtocol._ + @annotation.nowarn("cat=other-implicit-type") implicit val emperDescriptorFormat = yamlFormat3(Emper.apply) } diff --git a/benchmark-runner/main/src/de/fau/cs/mazstab/rts/OpenCilk.scala b/benchmark-runner/main/src/de/fau/cs/mazstab/rts/OpenCilk.scala index dd5b2a259eea5c69439daa47262622e3e1dcc2df..454d46ec1799ff2cb67d2d706feb349607aa64cb 100644 --- a/benchmark-runner/main/src/de/fau/cs/mazstab/rts/OpenCilk.scala +++ b/benchmark-runner/main/src/de/fau/cs/mazstab/rts/OpenCilk.scala @@ -26,11 +26,13 @@ object OpenCilkPrecondition { object OpenCilk { - val DistributionPaths = Set( - "/opt/opencilk", - "/opt/opencilk-1.1", - "/opt/opencilk-bin-1.1", - ).map(os.Path(_)) + val DistributionPaths = { + val versions = Seq("2.1", "1.1") + val optBase = "/opt/opencilk" + val versionPaths = + versions.map(v => Seq(f"${optBase}-${v}", f"${optBase}-bin-${v}")).flatten + (optBase +: versionPaths).map(os.Path(_)) + } private[rts] def cxx(path: os.Path) = path / "bin" / "clang++" diff --git a/benchmark-runner/millw-submodule b/benchmark-runner/millw-submodule index 55998337539921287897ca02f1e59b95896bfb92..2254cf000251f7f2bfe58d493cf1e3cac87681f7 160000 --- a/benchmark-runner/millw-submodule +++ b/benchmark-runner/millw-submodule @@ -1 +1 @@ -Subproject commit 55998337539921287897ca02f1e59b95896bfb92 +Subproject commit 2254cf000251f7f2bfe58d493cf1e3cac87681f7 diff --git a/benchmarks/integrate/integrate.cc b/benchmarks/integrate/integrate.cc index 434ad69fa7bfa3903e131156f2b19f14b3c6c86c..c264059d822705dcaa4c1f0faa70a43066b4e7ea 100644 --- a/benchmarks/integrate/integrate.cc +++ b/benchmarks/integrate/integrate.cc @@ -64,6 +64,7 @@ auto mzs_benchmark_verify() -> mzs::VerificationResult { return mzs::VerificationResult::successful; } + // NOLINTNEXTLINE(cert-err33-c) fprintf(stderr, "integrate(%d)=%lf (expected %lf)\n", n, m, expect); return mzs::VerificationResult::failed; } diff --git a/benchmarks/lu/lu.cc b/benchmarks/lu/lu.cc index 4468a4e0909aba2513738e551a645b31e64ad6e9..82f41068ba44cf4e29f75b8652530f51141e163e 100644 --- a/benchmarks/lu/lu.cc +++ b/benchmarks/lu/lu.cc @@ -40,7 +40,7 @@ typedef double Block[LU_BLOCK_SIZE][LU_BLOCK_SIZE]; /* A matrix is a 1D array of blocks. */ // NOLINTNEXTLINE(modernize-use-using) typedef Block *Matrix; -#define MATRIX(M, I, J) ((M)[(I)*nBlocks + (J)]) +#define MATRIX(M, I, J) ((M)[(I) * nBlocks + (J)]) /** Matrix size. */ int n = -1; diff --git a/benchmarks/matmul/matmul.cc b/benchmarks/matmul/matmul.cc index a3b1bf0dd8b1a7314a53935824f84db9cb2b1302..b03fd91ac1ef714dac6203eaa8c70eeba94478d6 100644 --- a/benchmarks/matmul/matmul.cc +++ b/benchmarks/matmul/matmul.cc @@ -138,6 +138,7 @@ auto mzs_benchmark_verify() -> mzs::VerificationResult { for (int j = 0; j < n; j++) { auto expected = static_cast<float>(n); if (c[i][j] != expected) { + // NOLINTNEXTLINE(cert-err33-c) fprintf(stderr, "c[%d][%d]=%f (expected %f)\n", i, j, c[i][j], expected); return mzs::VerificationResult::failed; } diff --git a/benchmarks/nqueens/nqueens.cc b/benchmarks/nqueens/nqueens.cc index c368aebf1cdffb6758012dc98593dde056bf1093..4fd6c0436cfaa4a177e1fc38a8335db1a84a4534 100644 --- a/benchmarks/nqueens/nqueens.cc +++ b/benchmarks/nqueens/nqueens.cc @@ -62,6 +62,7 @@ auto mzs_benchmark_verify() -> mzs::VerificationResult { 1, 0, 0, 2, 10, 4, 40, 92, 352, 724, 2680, 14200, 73712, 365596, 2279184, 14772512}; if (m != res[n - 1]) { + // NOLINTNEXTLINE(cert-err33-c) fprintf(stderr, "nqueens(%d)=%d (expected %d)\n", n, m, res[n - 1]); return mzs::VerificationResult::failed; } diff --git a/benchmarks/skynet/skynet.cc b/benchmarks/skynet/skynet.cc index c49342e558d55906a01d85fe659ee92be9759d54..3a41eca72b522f022b7a7f30ce141d6e6e463056 100644 --- a/benchmarks/skynet/skynet.cc +++ b/benchmarks/skynet/skynet.cc @@ -1,5 +1,6 @@ #include <array> #include <cassert> +#include <cstdint> #include <iostream> #include <numeric> @@ -42,7 +43,8 @@ auto mzs_benchmark_verify() -> mzs::VerificationResult { uint64_t expected = kleiner_gauß(size); if (expected != result) { - std::cerr << "FAILED recurse_sum(" << size << ")=" << result << " but expected " << expected << std::endl; + std::cerr << "FAILED recurse_sum(" << size << ")=" << result << " but expected " << expected + << std::endl; return mzs::VerificationResult::failed; } @@ -54,7 +56,7 @@ void mzs_benchmark_run() { recurse_sum(&result, 1, size); } -void mzs_benchmark_init(const mzs::ProblemSize &problem_size) { +void mzs_benchmark_init(const mzs::ProblemSize& problem_size) { switch (problem_size) { case mzs::ProblemSize::xs: size = 100; diff --git a/benchmarks/uts/Main.cpp b/benchmarks/uts/Main.cpp index 53f08804e9761e18c0a4aa51a85cc3d2f0f16aa3..916372d9a09883926a017d3180511d017a15ea0e 100644 --- a/benchmarks/uts/Main.cpp +++ b/benchmarks/uts/Main.cpp @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later // Copyright © 2022 Florian Schmaus #include <boost/program_options.hpp> +#include <cstdint> #include <iomanip> #include <iostream> @@ -9,7 +10,7 @@ namespace mzs = mazstab; namespace po = boost::program_options; -enum class MzsUtsCommand { +enum class MzsUtsCommand : std::uint8_t { dot, nodecount, }; diff --git a/benchmarks/uts/Node.cpp b/benchmarks/uts/Node.cpp index 271208f3e2c5c31a5c0ee3243c50270da50243c2..8b65ac25c24910469cc2745b6a7800e87aa49377 100644 --- a/benchmarks/uts/Node.cpp +++ b/benchmarks/uts/Node.cpp @@ -6,8 +6,8 @@ namespace mazstab::uts { -auto TreeConfiguration::determineChildrenCount(std::uint64_t depth, std::uint_fast64_t seed) const - -> size_t { +auto TreeConfiguration::determineChildrenCount(std::uint64_t depth, + std::uint_fast64_t seed) const -> size_t { std::mt19937_64 gen(seed); std::binomial_distribution<std::uint64_t> depth_dist(max_depth); @@ -44,7 +44,7 @@ void Node::determineChildren() { children.reserve(childrenCount); auto new_depth = depth + 1; - auto children_seeds = config.determineChildrenSeeds(childrenCount, seed); + auto children_seeds = mazstab::uts::TreeConfiguration::determineChildrenSeeds(childrenCount, seed); for (auto children_seed : children_seeds) { children.emplace_back(this, new_depth, children_seed, config); } diff --git a/benchmarks/uts/Node.hpp b/benchmarks/uts/Node.hpp index 58e4fd3e753468e1bcca960a29fc48e824ae74b2..04797e4493e5a6cf9906278c02c771e4aeae0d8c 100644 --- a/benchmarks/uts/Node.hpp +++ b/benchmarks/uts/Node.hpp @@ -18,8 +18,8 @@ class TreeConfiguration { // TODO: Future TreeConfigurations may require this method to become // non-static, ensure that the function delcares const if this // happens. - static auto determineChildrenSeeds(size_t childrenCount, std::uint_fast64_t seed) - -> std::vector<std::uint_fast64_t>; + static auto determineChildrenSeeds(size_t childrenCount, + std::uint_fast64_t seed) -> std::vector<std::uint_fast64_t>; }; class Node { diff --git a/meson.build b/meson.build index 4da76df33b3f037c42c8689eecdc0fdfd2d07703..760ce0d850dc22727a717d4cd40d2d85f84b3f09 100644 --- a/meson.build +++ b/meson.build @@ -11,6 +11,13 @@ project('Mazstab', 'c', 'cpp', # TODO: Re-enable that warning. add_project_arguments('-Wno-non-virtual-dtor', language: 'cpp') +cpp_compiler = meson.get_compiler('cpp') +cpp_is_clang = cpp_compiler.get_id() == 'clang' + +if cpp_is_clang + add_project_arguments('-Wno-vla-extension', language: 'cpp') +endif + threads_dep = dependency('threads') tools_dir = join_paths(meson.source_root(), 'tools') @@ -22,8 +29,6 @@ run_target( conf_data = configuration_data() -cpp_compiler = meson.get_compiler('cpp') - subdir('commonlib') boost_program_options_dep = dependency('boost', modules: ['program_options']) diff --git a/subprojects/emper.wrap b/subprojects/emper.wrap index d9fb64798b5afe4145471a525be636e9dc4175f9..cc1b5e586c92189d925efb9ceef2b3ebe1f3d7b4 100644 --- a/subprojects/emper.wrap +++ b/subprojects/emper.wrap @@ -1,4 +1,4 @@ [wrap-git] url = https://gitlab.cs.fau.de/i4/manycore/emper.git -revision = 105e4078814c1e1abffc6b3528a91a5780f461da +revision = b3baf2b54c5c41e103f5777c6d1e74f4c3161249 depth = 1 diff --git a/subprojects/packagefiles/fibril/meson.build b/subprojects/packagefiles/fibril/meson.build index 997379b2ef3d574ee2297764a0256290a88bf02e..6874c698a20afbb14c26689d695d867514e4ff33 100644 --- a/subprojects/packagefiles/fibril/meson.build +++ b/subprojects/packagefiles/fibril/meson.build @@ -2,7 +2,7 @@ project('fibril', 'c', meson_version : '>=0.57.0', ) -mod = import('unstable_external_project') +mod = import('unstable-external_project') bootstrap_command = run_command('bootstrap') if bootstrap_command.returncode() != 0 diff --git a/subprojects/packagefiles/nowa/meson.build b/subprojects/packagefiles/nowa/meson.build index 1405633c039977a54cfae481f0b2eee8ad160473..5d25f31d09bc75825ce7ef140e02536d0dd28870 100644 --- a/subprojects/packagefiles/nowa/meson.build +++ b/subprojects/packagefiles/nowa/meson.build @@ -2,7 +2,7 @@ project('nowa', 'c', meson_version : '>=0.57.0', ) -mod = import('unstable_external_project') +mod = import('unstable-external_project') bootstrap_command = run_command('bootstrap') if bootstrap_command.returncode() != 0 diff --git a/tools/run-clang-tidy b/tools/run-clang-tidy index e54b087bb93409a80e3b21ea46d5683c405447fa..dd7f135f2a1bf42020d509ef7126895e6b54e4c6 100755 --- a/tools/run-clang-tidy +++ b/tools/run-clang-tidy @@ -4,19 +4,10 @@ set -euo pipefail SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" ROOTDIR="$(realpath "${SCRIPTDIR}/..")" -while getopts dv OPT; do - case $OPT in - d) - set -x - ;; - - *) - echo "usage: ${0##*/} [-d]" - exit 2 - esac -done -shift $(( OPTIND - 1 )) -OPTIND=1 +if [[ $# -gt 0 && ${1} == -d ]]; then + set -x + shift 1 +fi RUN_CLANG_TIDY_CANDIDATES=( run-clang-tidy @@ -42,5 +33,5 @@ JOBS=$(nproc) ${RUN_CLANG_TIDY} \ -p "${ROOTDIR}/compile_commands_wo_subprojects/" \ - -j "${JOBS}" |\ + -j "${JOBS}" "${@}" |\ tee "${ROOTDIR}/clang-tidy-report"