Merge pull request #211 into master

5e7453d client: lib_linter: specify .clang-format location (Aaron Fiore)
abac2a3 container: c++: run linter (Aaron Fiore)
This commit is contained in:
2025-08-21 12:53:25 -07:00
6 changed files with 32 additions and 34 deletions

View File

@@ -2,7 +2,7 @@
# docker-finance | modern accounting for the power-user
#
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -170,7 +170,12 @@ function lib_linter::__lint_cpp()
local -r _path=("$@")
local -r _exts=("hh" "cc" "cpp" "C")
local -r _clang_format="clang-format -i"
local _clang_file
_clang_file="$(find ${DOCKER_FINANCE_CLIENT_REPO} -name .clang-format)"
[ -z "$_clang_file" ] && lib_utils::die_fatal ".clang-format not found"
declare -r _clang_file
local -r _clang_format="clang-format -i --style=file:${_clang_file}"
local -r _cpplint="cpplint --root=${DOCKER_FINANCE_CLIENT_REPO} --filter=-whitespace/braces,-whitespace/newline,-whitespace/line_length,-build/c++11 --headers=hh --extensions=hh,cc,cpp,C"
local -r _cppcheck="cppcheck --enable=warning,style,performance,portability --inline-suppr --std=c++17"

View File

@@ -288,16 +288,20 @@ class Random final
miles /= 24901;
// TODO(unassigned): would be nice to have some RNG-related info
pt->AddText(std::string{"Fun facts"}
.c_str()); // TODO(unassigned): make this small text
pt->AddText(std::string{
"There are " + std::to_string(is_odd) + " odd numbers and "
+ std::to_string(data.y.size() - is_odd) + " even numbers"}
.c_str());
pt->AddText(std::string{
"If the total values generated were miles, you could circle the earth "
+ std::to_string(miles) + " times!"}
.c_str());
pt->AddText(
std::string{"Fun facts"}
.c_str()); // TODO(unassigned): make this small text
pt->AddText(
std::string{
"There are " + std::to_string(is_odd) + " odd numbers and "
+ std::to_string(data.y.size() - is_odd) + " even numbers"}
.c_str());
pt->AddText(
std::string{
"If the total values generated were miles, you could circle the "
"earth "
+ std::to_string(miles) + " times!"}
.c_str());
pt->Draw();
}

View File

@@ -106,8 +106,7 @@ class Hash final : public t_impl
//! \endcode
template <
typename t_hash,
template <typename...>
typename t_container,
template <typename...> typename t_container,
typename... t_args,
std::enable_if_t<
type::is_signature_with_string<t_container<t_args...>>,
@@ -132,8 +131,7 @@ class Hash final : public t_impl
//! \endcode
template <
typename t_hash,
template <typename...>
typename t_container,
template <typename...> typename t_container,
typename... t_args,
std::enable_if_t<
type::is_signature_with_value_type_allocator<t_container<t_args...>>,
@@ -158,8 +156,7 @@ class Hash final : public t_impl
//! \endcode
template <
typename t_hash,
template <typename...>
typename t_container,
template <typename...> typename t_container,
typename... t_args,
std::enable_if_t<
type::is_signature_with_mapped_type_allocator<t_container<t_args...>>,

View File

@@ -151,8 +151,7 @@ class Transform : private ImplBase<t_impl>
template <
typename t_tag,
typename t_encoded,
template <typename...>
typename t_container,
template <typename...> typename t_container,
typename... t_args,
std::enable_if_t<
type::is_signature_with_string<t_container<t_args...>>,
@@ -169,8 +168,7 @@ class Transform : private ImplBase<t_impl>
template <
typename t_tag,
typename t_encoded,
template <typename...>
typename t_container,
template <typename...> typename t_container,
typename... t_args,
std::enable_if_t<
type::is_signature_with_value_type_allocator<t_container<t_args...>>,
@@ -222,8 +220,7 @@ class Transform : private ImplBase<t_impl>
template <
typename t_tag,
typename t_encoded,
template <typename...>
typename t_container,
template <typename...> typename t_container,
typename... t_args,
std::enable_if_t<
type::is_signature_with_mapped_type_allocator<t_container<t_args...>>,

View File

@@ -112,8 +112,7 @@ namespace libsodium
//! \ingroup cpp_API
//! \note For public consumption
//! \since docker-finance 1.0.0
using Random =
::dfi::crypto::common::Random<impl::libsodium::Random>;
using Random = ::dfi::crypto::common::Random<impl::libsodium::Random>;
} // namespace libsodium
} // namespace crypto

View File

@@ -141,8 +141,7 @@ class Byte final : public impl::Byte
}
template <
template <typename...>
typename t_container,
template <typename...> typename t_container,
typename... t_args,
std::enable_if_t<
type::is_signature_with_value_type_allocator<t_container<t_args...>>,
@@ -153,8 +152,7 @@ class Byte final : public impl::Byte
}
template <
template <typename...>
typename t_container,
template <typename...> typename t_container,
typename... t_args,
std::enable_if_t<
type::is_signature_with_mapped_type_allocator<t_container<t_args...>>,
@@ -172,8 +170,7 @@ class Byte final : public impl::Byte
}
template <
template <typename...>
typename t_container,
template <typename...> typename t_container,
typename... t_args,
std::enable_if_t<
type::is_signature_with_value_type_allocator<t_container<t_args...>>,
@@ -184,8 +181,7 @@ class Byte final : public impl::Byte
}
template <
template <typename...>
typename t_container,
template <typename...> typename t_container,
typename... t_args,
std::enable_if_t<
type::is_signature_with_mapped_type_allocator<t_container<t_args...>>,