diff --git a/.clang-tidy b/.clang-tidy index be97404..e85eff3 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -39,6 +39,7 @@ CheckOptions: cppcoreguidelines-rvalue-reference-param-not-moved.AllowPartialMove: 'true' cppcoreguidelines-avoid-magic-numbers.IgnoredIntegerValues: '1;2;3;4;10' cppcoreguidelines-avoid-magic-numbers.IgnoredFloatingPointValues: '1.0;2.0;10.0;100.0' + misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic: true google-readability-braces-around-statements.ShortStatementLines: '1' google-readability-namespace-comments.ShortNamespaceLines: '10' google-readability-namespace-comments.SpacesBeforeComments: '2' diff --git a/.cppcheck_suppress b/.cppcheck_suppress index fc80470..40c9e86 100644 --- a/.cppcheck_suppress +++ b/.cppcheck_suppress @@ -35,7 +35,7 @@ missingInclude *:*CLI11.hpp *:*json.hpp *:*boost_unordered.hpp -*:fmt/*.h +*:*fmt/*.h # Problem caused by external files toomanyconfigs # More problems caused by external files -- with too many ifdefs diff --git a/src/bgzf_reader.cpp b/src/bgzf_reader.cpp index a23f34e..eed3cc9 100644 --- a/src/bgzf_reader.cpp +++ b/src/bgzf_reader.cpp @@ -61,7 +61,7 @@ bgzf_reader::read_data() -> bool { if (at_eof()) return false; const auto unused_in = std::distance(next_in, end_in); - std::memcpy(inbuf.get(), next_in, unused_in); + std::copy_n(next_in, unused_in, inbuf.get()); next_in = inbuf.get(); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) end_in = next_in + unused_in; diff --git a/src/contaminant_set.cpp b/src/contaminant_set.cpp index 64126d7..859a0e1 100644 --- a/src/contaminant_set.cpp +++ b/src/contaminant_set.cpp @@ -11,7 +11,6 @@ #include #include #include -#include // for std::get #include #include diff --git a/src/contaminant_set.hpp b/src/contaminant_set.hpp index bd38475..8da93ac 100644 --- a/src/contaminant_set.hpp +++ b/src/contaminant_set.hpp @@ -5,7 +5,6 @@ #include #include -#include // for std::pair #include #include #include diff --git a/src/falco.cpp b/src/falco.cpp index 14fe9b3..e0a4c3f 100644 --- a/src/falco.cpp +++ b/src/falco.cpp @@ -345,17 +345,19 @@ main(int argc, char *argv[]) { argv = app.ensure_utf8(argv); app.usage( std::format("Usage: {} [options] -o OUTDIR INFILES", PROJECT_NAME)); + // NOLINTBEGIN(clang-analyzer-cplusplus.NewDeleteLeaks) if (argc >= 2) app.footer(std::format(description, falco::get_share_dir())); + // NOLINTEND(clang-analyzer-cplusplus.NewDeleteLeaks) // clang-format off // NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers) app.get_formatter()->long_option_alignment_ratio(0.2); app.set_help_flag("-h,--help", "Print more detailed help"); - // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) app.set_version_flag("--version", VERSION, "Print program version"); - app.add_flag("--license", [&](auto) { - std::print("{}", license_text); throw CLI::Success(); }, + app.add_flag("--license", + // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) + [&](auto) { std::print("{}", license_text); throw CLI::Success(); }, "Print full license") ->callback_priority(CLI::CallbackPriority::PreRequirementsCheck); auto infiles_opt = diff --git a/src/falco_analyzer.cpp b/src/falco_analyzer.cpp index 1938fac..fa66d41 100644 --- a/src/falco_analyzer.cpp +++ b/src/falco_analyzer.cpp @@ -20,7 +20,6 @@ #include #include #include -#include // for std::get (iwyu fp) #include #include #include diff --git a/src/html.cpp b/src/html.cpp index 3333cd1..b34324c 100644 --- a/src/html.cpp +++ b/src/html.cpp @@ -29,7 +29,6 @@ #include #include #include -#include // for std::get probably in fmt #include // for pair #include @@ -371,8 +370,8 @@ basic_stats_html(const file_info &info, [[nodiscard]] auto tile_html(const tile_processor::tiles_centered_t ¢ered, - const std::vector &groups, const file_grades &grades) - -> std::string { + const std::vector &groups, + const file_grades &grades) -> std::string { static constexpr auto label = "tile"; static constexpr auto n_quants = 20.0; // ADS: ??? (-10: red, 0: light blue, +10: dark blue) diff --git a/src/report.cpp b/src/report.cpp index 96149bf..438f5d1 100644 --- a/src/report.cpp +++ b/src/report.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -209,8 +210,8 @@ basic_stats_report(const file_info &info, [[nodiscard]] auto tile_report(const tile_processor::tiles_centered_t ¢ered, - const std::vector &groups, const file_grades &grades) - -> std::string { + const std::vector &groups, + const file_grades &grades) -> std::string { static constexpr auto label = "tile"; static constexpr auto max_precision{std::numeric_limits::digits10}; static constexpr auto start_tag = ">>Per tile sequence quality\t{}\n"; diff --git a/src/tile_processor.cpp b/src/tile_processor.cpp index 995ef35..7378450 100644 --- a/src/tile_processor.cpp +++ b/src/tile_processor.cpp @@ -26,7 +26,6 @@ #include #include #include -#include // for std::get #include #include