mirror of
https://github.com/mhx/dwarfs.git
synced 2025-08-04 10:16:34 -04:00
chore: add more clang-tidy exceptions
This commit is contained in:
parent
807dbb9aef
commit
fdcc93501b
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
// NOLINTBEGIN(cppcoreguidelines-macro-to-enum)
|
||||
#cmakedefine DWARFS_HAVE_LIBMAGIC 1
|
||||
#cmakedefine DWARFS_HAVE_LIBLZ4 1
|
||||
#cmakedefine DWARFS_HAVE_LIBLZMA 1
|
||||
@ -11,3 +12,4 @@
|
||||
#cmakedefine DWARFS_BUILTIN_MANPAGE 1
|
||||
#cmakedefine DWARFS_PERFMON_ENABLED 1
|
||||
#cmakedefine DWARFS_STACKTRACE_ENABLED 1
|
||||
// NOLINTEND(cppcoreguidelines-macro-to-enum)
|
||||
|
@ -50,6 +50,7 @@ class mmif : public boost::noncopyable {
|
||||
T const* as(U offset = 0) const {
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
|
||||
auto raw = static_cast<std::byte const*>(this->addr()) + offset;
|
||||
// NOLINTNEXTLINE(bugprone-casting-through-void)
|
||||
return static_cast<T const*>(static_cast<void const*>(raw));
|
||||
}
|
||||
|
||||
|
@ -148,9 +148,11 @@ class progress {
|
||||
std::chrono::steady_clock::time_point const start_;
|
||||
};
|
||||
|
||||
// NOLINTBEGIN(cppcoreguidelines-non-private-member-variables-in-classes)
|
||||
scan_progress similarity;
|
||||
scan_progress categorize;
|
||||
scan_progress hash;
|
||||
// NOLINTEND(cppcoreguidelines-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
void add_context(std::shared_ptr<context> const& ctx) const;
|
||||
|
@ -40,7 +40,9 @@ class scanner_progress : public progress::context {
|
||||
|
||||
status get_status() const override;
|
||||
|
||||
// NOLINTBEGIN(cppcoreguidelines-non-private-member-variables-in-classes)
|
||||
std::atomic<size_t> bytes_processed{0};
|
||||
// NOLINTEND(cppcoreguidelines-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
termcolor const color_;
|
||||
|
@ -58,6 +58,7 @@ class dwarfs_flac_stream_encoder final : public FLAC::Encoder::Stream {
|
||||
: data_{data}
|
||||
, pos_{data_.size()} {}
|
||||
|
||||
// NOLINTBEGIN(cppcoreguidelines-avoid-c-arrays)
|
||||
::FLAC__StreamEncoderReadStatus
|
||||
read_callback(FLAC__byte buffer[], size_t* bytes) override {
|
||||
::memcpy(buffer, data_.data() + pos_, *bytes);
|
||||
@ -75,6 +76,7 @@ class dwarfs_flac_stream_encoder final : public FLAC::Encoder::Stream {
|
||||
pos_ += bytes;
|
||||
return FLAC__STREAM_ENCODER_WRITE_STATUS_OK;
|
||||
}
|
||||
// NOLINTEND(cppcoreguidelines-avoid-c-arrays)
|
||||
|
||||
::FLAC__StreamEncoderSeekStatus
|
||||
seek_callback(FLAC__uint64 absolute_byte_offset) override {
|
||||
@ -113,6 +115,7 @@ class dwarfs_flac_stream_decoder final : public FLAC::Decoder::Stream {
|
||||
: pcm_sample_padding::Msb,
|
||||
bytes_per_sample_, header_.bits_per_sample().value()} {}
|
||||
|
||||
// NOLINTBEGIN(cppcoreguidelines-avoid-c-arrays)
|
||||
::FLAC__StreamDecoderReadStatus
|
||||
read_callback(FLAC__byte buffer[], size_t* bytes) override {
|
||||
if (pos_ >= data_.size()) {
|
||||
@ -153,6 +156,7 @@ class dwarfs_flac_stream_decoder final : public FLAC::Decoder::Stream {
|
||||
|
||||
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
|
||||
}
|
||||
// NOLINTEND(cppcoreguidelines-avoid-c-arrays)
|
||||
|
||||
void error_callback(::FLAC__StreamDecoderErrorStatus status) override {
|
||||
DWARFS_THROW(runtime_error,
|
||||
|
@ -90,6 +90,7 @@ bool is_fancy_impl() { return true; }
|
||||
|
||||
size_t width_impl() {
|
||||
struct ::winsize w;
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
|
||||
auto rv = ::ioctl(STDERR_FILENO, TIOCGWINSZ, &w);
|
||||
return rv == 0 ? w.ws_col : default_width;
|
||||
}
|
||||
|
@ -657,8 +657,10 @@ class segmenter_progress : public progress::context {
|
||||
return st;
|
||||
}
|
||||
|
||||
// NOLINTBEGIN(cppcoreguidelines-non-private-member-variables-in-classes)
|
||||
std::atomic<file const*> current_file{nullptr};
|
||||
std::atomic<size_t> bytes_processed{0};
|
||||
// NOLINTEND(cppcoreguidelines-non-private-member-variables-in-classes)
|
||||
|
||||
private:
|
||||
std::string const context_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user