Skip to content

Commit

Permalink
Enforce space between definitions (mamba-org#3049)
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoinePrv authored Dec 7, 2023
1 parent f36c3f2 commit 21675b6
Show file tree
Hide file tree
Showing 88 changed files with 77 additions and 88 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ PointerAlignment: Left
QualifierAlignment: Custom # Experimental
QualifierOrder: [inline, static, constexpr, const, volatile, type]
ReflowComments: 'true'
SeparateDefinitionBlocks: Always
SortIncludes: CaseInsensitive
SortUsingDeclarations: Never
SpaceAfterCStyleCast: 'true'
Expand Down
1 change: 0 additions & 1 deletion libmamba/include/mamba/api/clean.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#ifndef MAMBA_API_CLEAN_HPP
#define MAMBA_API_CLEAN_HPP


namespace mamba
{
const int MAMBA_CLEAN_ALL = 1 << 0;
Expand Down
1 change: 0 additions & 1 deletion libmamba/include/mamba/api/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#ifndef MAMBA_API_CONFIG_HPP
#define MAMBA_API_CONFIG_HPP


namespace mamba
{
class Configuration;
Expand Down
2 changes: 1 addition & 1 deletion libmamba/include/mamba/api/configuration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "mamba/fs/filesystem.hpp"
#include "mamba/util/environment.hpp"


namespace mamba
{
class Configuration;
Expand Down Expand Up @@ -407,6 +406,7 @@ namespace mamba
{
return m_context;
}

const Context& context() const
{
return m_context;
Expand Down
5 changes: 5 additions & 0 deletions libmamba/include/mamba/api/configuration_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,27 @@ namespace mamba
storage_type m_storage;

cli_config() = default;

cli_config(const T& value)
: m_storage(value)
{
}

storage_type& storage()
{
return m_storage;
}

bool has_value() const
{
return m_storage.has_value();
}

const T& value() const
{
return m_storage.value();
}

void reset()
{
m_storage.reset();
Expand Down
1 change: 0 additions & 1 deletion libmamba/include/mamba/api/update.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#ifndef MAMBA_API_UPDATE_HPP
#define MAMBA_API_UPDATE_HPP


namespace mamba
{
class Configuration;
Expand Down
7 changes: 7 additions & 0 deletions libmamba/include/mamba/core/activation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ namespace mamba
: Activator(context)
{
}

virtual ~PosixActivator() = default;

std::string script(const EnvironmentTransform& env_transform) override;
Expand All @@ -133,6 +134,7 @@ namespace mamba
: Activator(context)
{
}

virtual ~CshActivator() = default;

std::string script(const EnvironmentTransform& env_transform) override;
Expand All @@ -154,6 +156,7 @@ namespace mamba
: Activator(context)
{
}

virtual ~CmdExeActivator() = default;

std::string script(const EnvironmentTransform& env_transform) override;
Expand All @@ -175,6 +178,7 @@ namespace mamba
: Activator(context)
{
}

virtual ~PowerShellActivator() = default;

std::string script(const EnvironmentTransform& env_transform) override;
Expand All @@ -196,6 +200,7 @@ namespace mamba
: Activator(context)
{
}

virtual ~XonshActivator() = default;

std::string script(const EnvironmentTransform& env_transform) override;
Expand All @@ -217,6 +222,7 @@ namespace mamba
: Activator(context)
{
}

virtual ~FishActivator() = default;

std::string script(const EnvironmentTransform& env_transform) override;
Expand All @@ -238,6 +244,7 @@ namespace mamba
: Activator(context)
{
}

virtual ~NuActivator() = default;

std::string script(const EnvironmentTransform& env_transform) override;
Expand Down
1 change: 1 addition & 0 deletions libmamba/include/mamba/core/env_lockfile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ namespace mamba
{
return m_packages;
}

const Meta& get_metadata() const
{
return m_metadata;
Expand Down
1 change: 0 additions & 1 deletion libmamba/include/mamba/core/execution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ namespace mamba
}
}


// Closes this executor:
// Only returns once all tasks scheduled before this call are finished
// and all owned execution resources (aka threads) are released.
Expand Down
1 change: 1 addition & 0 deletions libmamba/include/mamba/core/menuinst.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace mamba
{
class Context;
class TransactionContext;

namespace fs
{
class u8path;
Expand Down
1 change: 1 addition & 0 deletions libmamba/include/mamba/core/pinning.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace mamba
class Context;
class ChannelContext;
class PrefixData;

namespace fs
{
class u8path;
Expand Down
1 change: 1 addition & 0 deletions libmamba/include/mamba/core/run.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace mamba
LockFile lock_proc_dir();

void daemonize();

class ScopedProcFile
{
const fs::u8path location;
Expand Down
3 changes: 3 additions & 0 deletions libmamba/include/mamba/core/satisfiability_error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,15 @@ namespace mamba
struct RootNode
{
};

struct PackageNode : PackageInfo
{
};

struct UnresolvedDependencyNode : MatchSpec
{
};

struct ConstraintNode : MatchSpec
{
};
Expand Down
6 changes: 6 additions & 0 deletions libmamba/include/mamba/core/solution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,35 @@ namespace mamba
{
PackageInfo what;
};

struct Upgrade
{
PackageInfo remove;
PackageInfo install;
};

struct Downgrade
{
PackageInfo remove;
PackageInfo install;
};

struct Change
{
PackageInfo remove;
PackageInfo install;
};

struct Reinstall
{
PackageInfo what;
};

struct Remove
{
PackageInfo remove;
};

struct Install
{
PackageInfo install;
Expand Down
1 change: 0 additions & 1 deletion libmamba/include/mamba/core/solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ namespace mamba
std::string description;
};


class MSolver
{
public:
Expand Down
1 change: 1 addition & 0 deletions libmamba/include/mamba/core/thread_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ namespace mamba
public:

thread_interrupted() = default;

const char* what() const throw()
{
return "Thread interrupted";
Expand Down
2 changes: 0 additions & 2 deletions libmamba/include/mamba/core/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ namespace mamba
// result == must_persist && must_persist_temporary_directories() == must_persist
bool set_persist_temporary_directories(bool will_persist);


class TemporaryDirectory
{
public:
Expand Down Expand Up @@ -327,7 +326,6 @@ namespace mamba
tl::expected<std::shared_ptr<LockFileOwner>, mamba_error> impl;
};


void split_package_extension(const std::string& file, std::string& name, std::string& extension);

std::string
Expand Down
5 changes: 1 addition & 4 deletions libmamba/include/mamba/fs/filesystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ namespace mamba::fs
return *this;
}


//---- Conversions ----

// Returns an utf-8 string.
Expand Down Expand Up @@ -519,7 +518,6 @@ namespace mamba::fs
return left.m_path != right;
}


//---- State ----

bool empty() const noexcept
Expand Down Expand Up @@ -763,6 +761,7 @@ namespace mamba::fs
{
return iter;
}

inline directory_iterator end(directory_iterator) noexcept
{
return {};
Expand Down Expand Up @@ -934,7 +933,6 @@ namespace mamba::fs
return std::filesystem::create_directory(path, attributes, std::forward<OtherArgs>(args)...);
}


// void create_directory_symlink(const path& to, const path& new_symlink);
// void create_directory_symlink(const path& to, const path& new_symlink, error_code& ec)
// noexcept;
Expand Down Expand Up @@ -980,7 +978,6 @@ namespace mamba::fs
std::filesystem::current_path(path, std::forward<OtherArgs>(args)...);
}


// bool equivalent(const path& p1, const path& p2);
// bool equivalent(const path& p1, const path& p2, error_code& ec) noexcept;
template <typename... OtherArgs>
Expand Down
1 change: 0 additions & 1 deletion libmamba/include/mamba/specs/repo_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ namespace mamba::specs
*/
void from_json(const nlohmann::json& j, RepoDataPackage& p);


/** Information about subdirectory of channel in the Conda RepoData. */
struct ChannelInfo
{
Expand Down
2 changes: 2 additions & 0 deletions libmamba/include/mamba/util/flat_binary_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ namespace mamba::util

using branch_type = Branch;
using leaf_type = Leaf;

struct branch_node
{
branch_type data;
std::size_t left_child = 0;
std::size_t right_child = 0;
};

using leaf_node = leaf_type;
using node_type = std::variant<branch_node, leaf_node>;
using node_list = std::vector<node_type>;
Expand Down
2 changes: 2 additions & 0 deletions libmamba/include/mamba/util/flat_bool_expr_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,11 @@ namespace mamba::util
private:

using postfix_parser_type = PostfixParser<variable_type, operator_type>;

struct LeftParenthesis
{
};

using operator_or_parenthesis_type = std::variant<operator_type, LeftParenthesis>;
using operator_stack_type = std::vector<operator_or_parenthesis_type>;

Expand Down
5 changes: 5 additions & 0 deletions libmamba/include/mamba/util/graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,22 +144,27 @@ namespace mamba::util
void start_node(node_id, const graph_t&)
{
}

void finish_node(node_id, const graph_t&)
{
}

void start_edge(node_id, node_id, const graph_t&)
{
}

void tree_edge(node_id, node_id, const graph_t&)
{
}

void back_edge(node_id, node_id, const graph_t&)
{
}

void forward_or_cross_edge(node_id, node_id, const graph_t&)
{
}

void finish_edge(node_id, node_id, const graph_t&)
{
}
Expand Down
2 changes: 0 additions & 2 deletions libmamba/include/mamba/util/iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ namespace mamba::util
using difference_type = D;
using iterator_category = std::bidirectional_iterator_tag;


friend derived_type operator--(derived_type& d, int)
{
derived_type tmp(d);
Expand Down Expand Up @@ -217,7 +216,6 @@ namespace mamba::util
template <class Predicate, class Iterator>
using select_filter_iterator_base_t = typename select_filter_iterator_base<Predicate, Iterator>::type;


template <class Predicate, class Iterator>
class filter_iterator : public select_filter_iterator_base_t<Predicate, Iterator>
{
Expand Down
3 changes: 3 additions & 0 deletions libmamba/include/mamba/util/string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,18 +522,21 @@ namespace mamba::util
struct has_reserve : std::false_type
{
};

template <class T>
struct has_reserve<T, std::void_t<decltype(std::declval<T>().reserve(std::size_t()))>>
: std::true_type
{
};

template <typename T>
inline constexpr bool has_reserve_v = has_reserve<T>::value;

std::size_t length(const char* s);
std::size_t length(const wchar_t* s);
std::size_t length(const char c);
std::size_t length(const wchar_t c);

template <class T>
std::size_t length(const T& s)
{
Expand Down
Loading

0 comments on commit 21675b6

Please sign in to comment.