Remove clang-tidy

This commit is contained in:
Jeremy 2023-09-19 15:26:51 -04:00
parent 5c3df2571e
commit 799e7a7705
No known key found for this signature in database
GPG Key ID: 19AA8270105E8EB4
9 changed files with 0 additions and 55 deletions

View File

@ -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

View File

@ -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\"

View File

@ -2,8 +2,6 @@
[![build](https://github.com/jeremy-rifkin/cpptrace/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/jeremy-rifkin/cpptrace/actions/workflows/build.yml)
[![test](https://github.com/jeremy-rifkin/cpptrace/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/jeremy-rifkin/cpptrace/actions/workflows/test.yml)
[![lint](https://github.com/jeremy-rifkin/cpptrace/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/jeremy-rifkin/cpptrace/actions/workflows/lint.yml)
<br/>
[![performance-test](https://github.com/jeremy-rifkin/cpptrace/actions/workflows/performance-tests.yml/badge.svg?branch=main)](https://github.com/jeremy-rifkin/cpptrace/actions/workflows/performance-tests.yml)
[![cmake-integration](https://github.com/jeremy-rifkin/cpptrace/actions/workflows/cmake-integration.yml/badge.svg?branch=main)](https://github.com/jeremy-rifkin/cpptrace/actions/workflows/cmake-integration.yml)
<br/>

14
lint.sh
View File

@ -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

View File

@ -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 {

View File

@ -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()*/,

View File

@ -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<!std::is_same<typename std::decay<U>::type, optional<T>>::value, int>::type = 0
>
// clang-tidy false positive
// NOLINTNEXTLINE(bugprone-forwarding-reference-overload)
optional(U&& value) : holds_value(true) {
new (static_cast<void*>(std::addressof(uvalue))) T(std::forward<U>(value));
}

View File

@ -16,7 +16,6 @@
#if IS_LINUX || IS_APPLE
#include <unistd.h>
// NOLINTNEXTLINE(misc-include-cleaner)
#include <sys/types.h>
#include <sys/wait.h>
#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 "<symbol> at path:line"
@ -270,7 +265,6 @@ namespace addr2line {
#endif
}
// NOLINTNEXTLINE(readability-convert-member-functions-to-static)
std::vector<stacktrace_frame> resolve_frames(const std::vector<object_frame>& frames) {
// TODO: Refactor better
std::vector<stacktrace_frame> trace(frames.size());

View File

@ -47,7 +47,6 @@ namespace libbacktrace {
static std::mutex mutex;
const std::lock_guard<std::mutex> 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) {