From 799e7a7705779f91d061531f8eec94c2edd620c6 Mon Sep 17 00:00:00 2001
From: Jeremy <51220084+jeremy-rifkin@users.noreply.github.com>
Date: Tue, 19 Sep 2023 15:26:51 -0400
Subject: [PATCH] Remove clang-tidy
---
.clang-tidy | 6 ------
.github/workflows/lint.yml | 18 ------------------
README.md | 2 --
lint.sh | 14 --------------
src/demangle/demangle_with_cxxabi.cpp | 1 -
src/platform/error.hpp | 2 --
src/platform/utils.hpp | 5 -----
src/symbols/symbols_with_addr2line.cpp | 6 ------
src/symbols/symbols_with_libbacktrace.cpp | 1 -
9 files changed, 55 deletions(-)
delete mode 100644 .clang-tidy
delete mode 100644 .github/workflows/lint.yml
delete mode 100644 lint.sh
diff --git a/.clang-tidy b/.clang-tidy
deleted file mode 100644
index aefe79d..0000000
--- a/.clang-tidy
+++ /dev/null
@@ -1,6 +0,0 @@
----
-Checks: '-*,clang-diagnostic-*,clang-analyzer-*,bugprone-*,cert-*,clang-analyzer-*,concurrency-*,cppcoreguidelines-*,misc-*,modernize-*,performance-*,portability-*,readability-*,-cppcoreguidelines-macro-usage,-modernize-use-trailing-return-type,-misc-non-private-member-variables-in-classes,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-avoid-c-arrays,-modernize-avoid-c-arrays,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-readability-else-after-return,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cert-dcl50-cpp,-cppcoreguidelines-init-variables,-readability-implicit-bool-conversion,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-owning-memory,-cppcoreguidelines-pro-type-member-init,-readability-isolate-declaration,-cppcoreguidelines-avoid-magic-numbers,-readability-magic-numbers,-cppcoreguidelines-pro-type-union-access,-cppcoreguidelines-pro-type-cstyle-cast,-readability-named-parameter,-cppcoreguidelines-avoid-goto,-readability-uppercase-literal-suffix,-performance-avoid-endl,-bugprone-easily-swappable-parameters,-cppcoreguidelines-non-private-member-variables-in-classes'
-WarningsAsErrors: '*'
-HeaderFilterRegex: ''
-AnalyzeTemporaryDtors: false
-FormatStyle: none
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
deleted file mode 100644
index 401b5a1..0000000
--- a/.github/workflows/lint.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-name: lint
-
-on:
- push:
- pull_request:
-
-jobs:
- lint:
- runs-on: ubuntu-20.04
- steps:
- - uses: actions/checkout@v2
- - name: dependencies
- run: |
- sudo apt install clang-tidy
- - name: clang-tidy
- run: |
- chmod +x lint.sh
- ./lint.sh -DCPPTRACE_BACKTRACE_PATH=\"/usr/lib/gcc/x86_64-linux-gnu/10/include/backtrace.h\"
diff --git a/README.md b/README.md
index 7576b6e..5e6ffea 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,6 @@
[](https://github.com/jeremy-rifkin/cpptrace/actions/workflows/build.yml)
[](https://github.com/jeremy-rifkin/cpptrace/actions/workflows/test.yml)
-[](https://github.com/jeremy-rifkin/cpptrace/actions/workflows/lint.yml)
-
[](https://github.com/jeremy-rifkin/cpptrace/actions/workflows/performance-tests.yml)
[](https://github.com/jeremy-rifkin/cpptrace/actions/workflows/cmake-integration.yml)
diff --git a/lint.sh b/lint.sh
deleted file mode 100644
index 1098283..0000000
--- a/lint.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-status=0
-while read f
-do
- echo checking $f
- flags="-DCPPTRACE_GET_SYMBOLS_WITH_LIBBACKTRACE -DCPPTRACE_GET_SYMBOLS_WITH_LIBDL -DCPPTRACE_GET_SYMBOLS_WITH_ADDR2LINE -DCPPTRACE_GET_SYMBOLS_WITH_NOTHING -DCPPTRACE_UNWIND_WITH_EXECINFO -DCPPTRACE_UNWIND_WITH_UNWIND -DCPPTRACE_UNWIND_WITH_NOTHING -DCPPTRACE_DEMANGLE_WITH_CXXABI -DCPPTRACE_DEMANGLE_WITH_NOTHING -DCPPTRACE_ADDR2LINE_SEARCH_SYSTEM_PATH"
- clang-tidy $f -- -std=c++11 -Iinclude $@ $flags
- ret=$?
- if [ $ret -ne 0 ]; then
- status=1
- fi
-done <<< $(find include src -name "*.hpp" -o -name "*.cpp" -not -path "test/speedtest.cpp" -not -path "src/full/full_trace_with_stacktrace.cpp")
-exit $status
diff --git a/src/demangle/demangle_with_cxxabi.cpp b/src/demangle/demangle_with_cxxabi.cpp
index 1aadaae..a2e5155 100644
--- a/src/demangle/demangle_with_cxxabi.cpp
+++ b/src/demangle/demangle_with_cxxabi.cpp
@@ -19,7 +19,6 @@ namespace detail {
// we'll just quietly return the mangled name
if(demangled) {
std::string str = demangled;
- // NOLINTNEXTLINE(cppcoreguidelines-no-malloc)
std::free(demangled);
return str;
} else {
diff --git a/src/platform/error.hpp b/src/platform/error.hpp
index 54c8737..77353f1 100644
--- a/src/platform/error.hpp
+++ b/src/platform/error.hpp
@@ -23,10 +23,8 @@ namespace detail {
// Lightweight std::source_location.
struct source_location {
- // NOLINTNEXTLINE(cppcoreguidelines-avoid-const-or-ref-data-members)
const char* const file;
//const char* const function; // disabled for now due to static constexpr restrictions
- // NOLINTNEXTLINE(cppcoreguidelines-avoid-const-or-ref-data-members)
const int line;
constexpr source_location(
//const char* _function /*= __builtin_FUNCTION()*/,
diff --git a/src/platform/utils.hpp b/src/platform/utils.hpp
index 282cb2f..e7c2699 100644
--- a/src/platform/utils.hpp
+++ b/src/platform/utils.hpp
@@ -142,7 +142,6 @@ namespace detail {
#endif
}
- // NOLINTNEXTLINE(misc-no-recursion)
inline constexpr unsigned n_digits(unsigned value) {
return value < 10 ? 1 : 1 + n_digits(value / 10);
}
@@ -177,8 +176,6 @@ namespace detail {
};
public:
- // clang-tidy false positive
- // NOLINTNEXTLINE(modernize-use-equals-default)
optional() noexcept {}
optional(nullopt_t) noexcept {}
@@ -223,8 +220,6 @@ namespace detail {
typename U = T,
typename std::enable_if::type, optional>::value, int>::type = 0
>
- // clang-tidy false positive
- // NOLINTNEXTLINE(bugprone-forwarding-reference-overload)
optional(U&& value) : holds_value(true) {
new (static_cast(std::addressof(uvalue))) T(std::forward(value));
}
diff --git a/src/symbols/symbols_with_addr2line.cpp b/src/symbols/symbols_with_addr2line.cpp
index 0a739fe..b9b8013 100644
--- a/src/symbols/symbols_with_addr2line.cpp
+++ b/src/symbols/symbols_with_addr2line.cpp
@@ -16,7 +16,6 @@
#if IS_LINUX || IS_APPLE
#include
- // NOLINTNEXTLINE(misc-include-cleaner)
#include
#include
#endif
@@ -36,7 +35,6 @@ namespace addr2line {
checked = true;
// Detects if addr2line exists by trying to invoke addr2line --help
constexpr int magic = 42;
- // NOLINTNEXTLINE(misc-include-cleaner)
const pid_t pid = fork();
if(pid == -1) { return false; }
if(pid == 0) { // child
@@ -58,7 +56,6 @@ namespace addr2line {
}
int status;
waitpid(pid, &status, 0);
- // NOLINTNEXTLINE(misc-include-cleaner)
has_addr2line = WEXITSTATUS(status) == 0;
}
return has_addr2line;
@@ -80,7 +77,6 @@ namespace addr2line {
pipe_t input_pipe;
CPPTRACE_VERIFY(pipe(output_pipe.data) == 0);
CPPTRACE_VERIFY(pipe(input_pipe.data) == 0);
- // NOLINTNEXTLINE(misc-include-cleaner)
const pid_t pid = fork();
if(pid == -1) { return ""; } // error? TODO: Diagnostic
if(pid == 0) { // child
@@ -190,7 +186,6 @@ namespace addr2line {
}
#endif
- // NOLINTNEXTLINE(readability-convert-member-functions-to-static)
void update_trace(const std::string& line, size_t entry_index, const collated_vec& entries_vec) {
#if !IS_APPLE
// Result will be of the form " at path:line"
@@ -270,7 +265,6 @@ namespace addr2line {
#endif
}
- // NOLINTNEXTLINE(readability-convert-member-functions-to-static)
std::vector resolve_frames(const std::vector& frames) {
// TODO: Refactor better
std::vector trace(frames.size());
diff --git a/src/symbols/symbols_with_libbacktrace.cpp b/src/symbols/symbols_with_libbacktrace.cpp
index 40d6593..e4c86fa 100644
--- a/src/symbols/symbols_with_libbacktrace.cpp
+++ b/src/symbols/symbols_with_libbacktrace.cpp
@@ -47,7 +47,6 @@ namespace libbacktrace {
static std::mutex mutex;
const std::lock_guard lock(mutex);
// backtrace_create_state must be called only one time per program
- // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
static backtrace_state* state = nullptr;
static bool called = false;
if(!called) {