Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pre-commit hooks to latest versions in F41 #1932

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude:
Expand All @@ -12,13 +12,13 @@ repos:
- id: check-added-large-files
- id: check-merge-conflict
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.5
rev: v19.1.0
hooks:
- id: clang-format
types_or:
- c++
- repo: https://github.com/hhatto/autopep8
rev: v2.0.4
rev: v2.2.0
hooks:
- id: autopep8
- repo: https://github.com/rpm-software-management/rpmlint.git
Expand Down
2 changes: 1 addition & 1 deletion dnf5-plugins/automatic_plugin/config_automatic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class ConfigAutomaticCommandEmail : public libdnf5::Config {

class ConfigAutomatic {
public:
ConfigAutomatic(){};
ConfigAutomatic() {};
~ConfigAutomatic() = default;

void load_from_parser(
Expand Down
2 changes: 1 addition & 1 deletion dnf5-plugins/copr_plugin/copr_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class RepoListCB : public CoprRepoCallback {
std::string hostname;

public:
explicit RepoListCB(const std::string & host) : hostname(host){};
explicit RepoListCB(const std::string & host) : hostname(host) {};
dnf5::CoprRepoCallback list = [&](dnf5::CoprRepo & cr) {
if (!hostname.empty() && cr.get_id().rfind(hostname + "/", 0) != 0)
return;
Expand Down
4 changes: 2 additions & 2 deletions dnf5-plugins/copr_plugin/copr_repo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void available_chroots_error(

class CoprRepoPart {
public:
CoprRepoPart(){};
CoprRepoPart() {};
explicit CoprRepoPart(libdnf5::repo::RepoWeakPtr dnfRepo) {
/// Copr enable/disable simply always generates the repofile from
/// scratch ('enable' from the json provided by Copr Frontend, 'disable'
Expand Down Expand Up @@ -175,7 +175,7 @@ class CoprRepoPart {

class CoprRepo {
public:
CoprRepo(){};
CoprRepo() {};

explicit CoprRepo(
libdnf5::Base & base,
Expand Down
2 changes: 1 addition & 1 deletion dnf5daemon-client/callbacks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Context;

class DbusCallback {
public:
explicit DbusCallback(Context & context) : context(context){};
explicit DbusCallback(Context & context) : context(context) {};
virtual ~DbusCallback() = default;

protected:
Expand Down
4 changes: 2 additions & 2 deletions dnf5daemon-client/commands/command.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace dnfdaemon::client {

class DaemonCommand : public libdnf5::cli::session::Command {
public:
explicit DaemonCommand(Context & context, const std::string & name) : Command(context, name){};
explicit DaemonCommand(Context & context, const std::string & name) : Command(context, name) {};
virtual dnfdaemon::KeyValueMap session_config() {
dnfdaemon::KeyValueMap cfg = {};
return cfg;
Expand All @@ -41,7 +41,7 @@ class DaemonCommand : public libdnf5::cli::session::Command {

class TransactionCommand : public DaemonCommand {
public:
explicit TransactionCommand(Context & context, const std::string & name) : DaemonCommand(context, name){};
explicit TransactionCommand(Context & context, const std::string & name) : DaemonCommand(context, name) {};
void run_transaction(bool offline = false);
};

Expand Down
2 changes: 1 addition & 1 deletion dnf5daemon-client/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ constexpr const char * VERSION = "0.1.0";

class Context : public libdnf5::cli::session::Session {
public:
Context() : repositories_status(dnfdaemon::RepoStatus::NOT_READY){};
Context() : repositories_status(dnfdaemon::RepoStatus::NOT_READY) {};

/// Initialize dbus connection and server session
void init_session(sdbus::IConnection & connection);
Expand Down
2 changes: 1 addition & 1 deletion dnf5daemon-client/wrappers/dbus_environment_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

namespace dnfdaemon::client {

DbusEnvironmentWrapper::DbusEnvironmentWrapper(const dnfdaemon::KeyValueMap & rawdata) : rawdata(rawdata){};
DbusEnvironmentWrapper::DbusEnvironmentWrapper(const dnfdaemon::KeyValueMap & rawdata) : rawdata(rawdata) {};

std::set<std::string> DbusEnvironmentWrapper::get_repos() const {
std::vector<std::string> repos_vector = rawdata.at("repos");
Expand Down
2 changes: 1 addition & 1 deletion dnf5daemon-client/wrappers/dbus_package_wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace dnfdaemon::client {

class DbusPackageWrapper {
public:
explicit DbusPackageWrapper(const dnfdaemon::KeyValueMap & rawdata) : rawdata(rawdata){};
explicit DbusPackageWrapper(const dnfdaemon::KeyValueMap & rawdata) : rawdata(rawdata) {};

int get_id() { return rawdata.at("id"); }
std::string get_name() const { return rawdata.at("name"); }
Expand Down
2 changes: 1 addition & 1 deletion dnf5daemon-client/wrappers/dbus_repo_wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace dnfdaemon::client {

class DbusRepoWrapper : public libdnf5::cli::output::IRepoInfo {
public:
explicit DbusRepoWrapper(dnfdaemon::KeyValueMap & rawdata) : rawdata(rawdata){};
explicit DbusRepoWrapper(dnfdaemon::KeyValueMap & rawdata) : rawdata(rawdata) {};

std::string get_id() const { return rawdata.at("id"); }
std::string get_name() const { return rawdata.at("name"); }
Expand Down
2 changes: 1 addition & 1 deletion dnf5daemon-server/callbacks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class DbusTransactionCB : public libdnf5::rpm::TransactionCallbacks, public Dbus
void verify_stop(uint64_t total) override;

void unpack_error(const libdnf5::base::TransactionPackage & item) override;
void cpio_error(const libdnf5::base::TransactionPackage & /*item*/) override{};
void cpio_error(const libdnf5::base::TransactionPackage & /*item*/) override {};

// whole rpm transaction is finished
void finish();
Expand Down
2 changes: 1 addition & 1 deletion dnf5daemon-server/session.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Session;

class IDbusSessionService {
public:
explicit IDbusSessionService(Session & session) : session(session){};
explicit IDbusSessionService(Session & session) : session(session) {};
virtual ~IDbusSessionService() = default;
virtual void dbus_register() = 0;

Expand Down
3 changes: 1 addition & 2 deletions include/libdnf5/common/exception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#include <stdexcept>
#include <type_traits>

#define LIBDNF_LOCATION \
{ __FILE__, __LINE__, __PRETTY_FUNCTION__ }
#define LIBDNF_LOCATION {__FILE__, __LINE__, __PRETTY_FUNCTION__}

/// An assert macro that throws `libdnf5::AssertionError`.
///
Expand Down
2 changes: 1 addition & 1 deletion libdnf5-cli/output/transaction_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class TransactionTableSection {
TransactionTableSection(std::string header, struct libscols_line * line)
: header(std::move(header)),
first_line(line),
last_line(line){};
last_line(line) {};
std::string get_header() const { return header; }
struct libscols_line * get_first_line() const { return first_line; }
struct libscols_line * get_last_line() const { return last_line; }
Expand Down
2 changes: 1 addition & 1 deletion libdnf5-cli/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ StringArgumentList::StringArgumentList(

StringArgumentList::StringArgumentList(
libdnf5::cli::session::Command & command, const std::string & name, const std::string & desc)
: StringArgumentList(command, name, desc, ArgumentParser::PositionalArg::UNLIMITED){};
: StringArgumentList(command, name, desc, ArgumentParser::PositionalArg::UNLIMITED) {};

StringArgumentList::~StringArgumentList() = default;

Expand Down
2 changes: 1 addition & 1 deletion libdnf5/conf/option.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace libdnf5 {

class Option::Impl {
public:
Impl(Priority priority) : priority(priority){};
Impl(Priority priority) : priority(priority) {};

private:
friend Option;
Expand Down
2 changes: 1 addition & 1 deletion libdnf5/conf/option_binds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class OptionBinds::Item::Impl {
get_value_str_func(std::move(get_value_string_func)),
is_append_option(add_value) {}

Impl(Option & option) : option(&option){};
Impl(Option & option) : option(&option) {};

private:
friend OptionBinds::Item;
Expand Down
2 changes: 1 addition & 1 deletion libdnf5/conf/option_path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace libdnf5 {

class OptionPath::Impl {
public:
Impl(bool exists, bool abs_path) : exists(exists), abs_path(abs_path){};
Impl(bool exists, bool abs_path) : exists(exists), abs_path(abs_path) {};

private:
friend OptionPath;
Expand Down
6 changes: 3 additions & 3 deletions libdnf5/conf/option_string_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ class OptionStringContainer<T, IsAppend>::Impl {
: icase(false),
default_value(default_value),
value(default_value),
value_append({{Option::Priority::DEFAULT, std::move(default_value)}}){};
value_append({{Option::Priority::DEFAULT, std::move(default_value)}}) {};
Impl(T && default_value, std::string && regex, bool icase)
: regex(std::move(regex)),
icase(icase),
default_value(default_value),
value(default_value),
value_append({{Option::Priority::DEFAULT, std::move(default_value)}}){};
value_append({{Option::Priority::DEFAULT, std::move(default_value)}}) {};
Impl(T && default_value, std::string && regex, bool icase, std::string && delimiters)
: regex(std::move(regex)),
icase(icase),
delimiters(std::move(delimiters)),
default_value(default_value),
value(default_value),
value_append({{Option::Priority::DEFAULT, std::move(default_value)}}){};
value_append({{Option::Priority::DEFAULT, std::move(default_value)}}) {};

// For append options the method stores the value to value_append multimap and
// then recalculates this->value.
Expand Down
8 changes: 4 additions & 4 deletions libdnf5/conf/option_string_private.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ namespace libdnf5 {

class OptionString::Impl {
public:
Impl(std::string && default_value) : icase(false), default_value(default_value), value(std::move(default_value)){};
Impl() : icase(false){};
Impl(std::string && regex, bool icase) : regex(std::move(regex)), icase(icase){};
Impl(std::string && default_value) : icase(false), default_value(default_value), value(std::move(default_value)) {};
Impl() : icase(false) {};
Impl(std::string && regex, bool icase) : regex(std::move(regex)), icase(icase) {};
Impl(std::string && default_value, std::string && regex, bool icase)
: regex(std::move(regex)),
icase(icase),
default_value(default_value),
value(std::move(default_value)){};
value(std::move(default_value)) {};

std::string regex;
bool icase;
Expand Down
3 changes: 1 addition & 2 deletions libdnf5/conf/vars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,7 @@ void Vars::load(const std::string & installroot, const std::vector<std::string>
}

void Vars::detect_vars(const std::string & installroot) {
set_lazy(
"arch", []() -> auto { return std::make_unique<std::string>(utils::detect_arch()); }, Priority::AUTO);
set_lazy("arch", []() -> auto { return std::make_unique<std::string>(utils::detect_arch()); }, Priority::AUTO);

utils::init_lib_rpm(get_value("arch").c_str());

Expand Down
4 changes: 2 additions & 2 deletions libdnf5/logger/log_router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ namespace libdnf5 {

class LogRouter::Impl {
public:
Impl(){};
Impl() {};
Impl(std::vector<std::unique_ptr<Logger>> && loggers) : loggers(std::move(loggers)) {}

private:
friend LogRouter;
std::vector<std::unique_ptr<Logger>> loggers;
};

LogRouter::LogRouter() : p_impl(new Impl()){};
LogRouter::LogRouter() : p_impl(new Impl()) {};

LogRouter::~LogRouter() = default;

Expand Down
2 changes: 1 addition & 1 deletion libdnf5/module/module_metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
namespace libdnf5::module {


ModuleMetadata::ModuleMetadata(const BaseWeakPtr & base) : base(base){};
ModuleMetadata::ModuleMetadata(const BaseWeakPtr & base) : base(base) {};
ModuleMetadata::ModuleMetadata(libdnf5::Base & base) : base(base.get_weak_ptr()) {}


Expand Down
2 changes: 1 addition & 1 deletion libdnf5/repo/repo_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ RepoCacheRemoveStatistics & RepoCacheRemoveStatistics::operator+=(const RepoCach
return *this;
}

RepoCacheRemoveStatistics::RepoCacheRemoveStatistics() : p_impl(new Impl()){};
RepoCacheRemoveStatistics::RepoCacheRemoveStatistics() : p_impl(new Impl()) {};
RepoCacheRemoveStatistics::~RepoCacheRemoveStatistics() = default;

RepoCacheRemoveStatistics::RepoCacheRemoveStatistics(const RepoCacheRemoveStatistics & src) = default;
Expand Down
3 changes: 1 addition & 2 deletions libdnf5/repo/repo_downloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#define PACKAGES_RELATIVE_DIR "packages"
#define METALINK_FILENAME "metalink.xml"
#define MIRRORLIST_FILENAME "mirrorlist"
#define RECOGNIZED_CHKSUMS \
{ "sha512", "sha256" }
#define RECOGNIZED_CHKSUMS {"sha512", "sha256"}


namespace libdnf5::repo {
Expand Down
2 changes: 1 addition & 1 deletion libdnf5/repo/repo_query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace libdnf5::repo {

class RepoQuery::Impl {
public:
Impl(const BaseWeakPtr & base) : base(base){};
Impl(const BaseWeakPtr & base) : base(base) {};

private:
friend RepoQuery;
Expand Down
2 changes: 1 addition & 1 deletion libdnf5/rpm/nevra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ int rpmvercmp(const char * lhs, const char * rhs) {
return ::rpmvercmp(lhs, rhs);
}

Nevra::Nevra() : p_impl(new Impl()){};
Nevra::Nevra() : p_impl(new Impl()) {};
Nevra::~Nevra() = default;

Nevra::Nevra(const Nevra & src) = default;
Expand Down
2 changes: 1 addition & 1 deletion libdnf5/rpm/package_query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ void PackageQuery::filter_arch(const std::vector<std::string> & patterns, libdnf
namespace {

struct NevraID {
NevraID() : name(0), arch(0), evr(0){};
NevraID() : name(0), arch(0), evr(0) {};
NevraID(const NevraID & src) = default;
NevraID(NevraID && src) noexcept = default;
NevraID & operator=(const NevraID & src) = default;
Expand Down
2 changes: 1 addition & 1 deletion libdnf5/rpm/rpm_log_guard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class RpmLogGuard : public RpmLogGuardBase {
class RpmLogGuardStrings : public RpmLogGuardBase {
public:
RpmLogGuardStrings();
~RpmLogGuardStrings(){};
~RpmLogGuardStrings() {};

const std::vector<std::string> & get_rpm_logs() const { return rpm_logs; }
void add_rpm_log(const std::string & log) { rpm_logs.emplace_back(log); }
Expand Down
2 changes: 1 addition & 1 deletion libdnf5/solv/solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace libdnf5::solv {

class Solver {
public:
Solver(){};
Solver() {};
explicit Solver(Pool & pool);

Solver(const Solver & solver) = delete;
Expand Down
2 changes: 1 addition & 1 deletion libdnf5/transaction/offline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class OfflineTransactionStateData::Impl {

OfflineTransactionStateData::~OfflineTransactionStateData() = default;

OfflineTransactionStateData::OfflineTransactionStateData() : p_impl(std::make_unique<Impl>()){};
OfflineTransactionStateData::OfflineTransactionStateData() : p_impl(std::make_unique<Impl>()) {};
OfflineTransactionStateData::OfflineTransactionStateData(const OfflineTransactionStateData & src)
: p_impl(new Impl(*src.p_impl)) {}
OfflineTransactionStateData::OfflineTransactionStateData(OfflineTransactionStateData && src) noexcept = default;
Expand Down
2 changes: 1 addition & 1 deletion libdnf5/utils/locker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

namespace libdnf5::utils {

Locker::Locker(const std::string & path) : path(path){};
Locker::Locker(const std::string & path) : path(path) {};

bool Locker::read_lock() {
return lock(F_RDLCK);
Expand Down
2 changes: 1 addition & 1 deletion test/shared/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ std::vector<libdnf5::rpm::Package> to_vector(const libdnf5::rpm::PackageSet & pa
// Together with ASSERT_MATCHES implements convenient fnmatch pattern matching
class Pattern {
public:
Pattern(const char * str) : value(str){};
Pattern(const char * str) : value(str) {};
bool matches(const std::string & actual) { return !fnmatch(value.c_str(), actual.c_str(), FNM_EXTMATCH); }
std::string value;
};
Expand Down
Loading