Update the formatting to now allow functions on a single line

This makes it less annoying when the IDE is auto-formatting while you type
main
Duncan Ogilvie 2 years ago
parent 3a1298f4e8
commit a90988b81a

@ -10,7 +10,7 @@ AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: true
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None

@ -126,13 +126,17 @@ void generate_project(const std::string &type) {
struct CommandEndl {
std::stringstream &ss;
CommandEndl(std::stringstream &ss) : ss(ss) {}
void endl() { ss << '\n'; }
CommandEndl(std::stringstream &ss) : ss(ss) {
}
void endl() {
ss << '\n';
}
};
struct RawArg {
RawArg() = default;
RawArg(std::string arg) : arg(std::move(arg)) {}
RawArg(std::string arg) : arg(std::move(arg)) {
}
std::string arg;
};
@ -148,7 +152,8 @@ struct Command {
std::string post_comment;
Command(std::stringstream &ss, int depth, std::string command, std::string post_comment)
: ss(ss), depth(depth), command(std::move(command)), post_comment(std::move(post_comment)) {}
: ss(ss), depth(depth), command(std::move(command)), post_comment(std::move(post_comment)) {
}
~Command() noexcept(false) {
if (!generated) {
@ -317,7 +322,8 @@ static std::string tolf(const std::string &str) {
};
struct Generator {
Generator(const parser::Project &project) : project(project) {}
Generator(const parser::Project &project) : project(project) {
}
Generator(const Generator &) = delete;
const parser::Project &project;
@ -343,7 +349,9 @@ struct Generator {
return CommandEndl(ss);
}
void endl() { ss << '\n'; }
void endl() {
ss << '\n';
}
void inject_includes(const std::vector<std::string> &includes) {
if (!includes.empty()) {

@ -6,11 +6,16 @@
namespace cmkr {
namespace error {
Status::Status(Code ec) noexcept : ec_(ec) {}
Status::Status(Code ec) noexcept : ec_(ec) {
}
Status::operator int() const noexcept { return static_cast<int>(ec_); }
Status::operator int() const noexcept {
return static_cast<int>(ec_);
}
Status::Code Status::code() const noexcept { return ec_; }
Status::Code Status::code() const noexcept {
return ec_;
}
} // namespace error
} // namespace cmkr

@ -4,7 +4,9 @@
namespace cmkr {
namespace help {
const char *version() noexcept { return "cmkr version " CMKR_VERSION; }
const char *version() noexcept {
return "cmkr version " CMKR_VERSION;
}
const char *message() noexcept {
return R"lit(
@ -22,6 +24,10 @@ arguments:
} // namespace help
} // namespace cmkr
const char *cmkr_help_version(void) { return cmkr::help::version(); }
const char *cmkr_help_version(void) {
return cmkr::help::version();
}
const char *cmkr_help_message(void) { return cmkr::help::message(); }
const char *cmkr_help_message(void) {
return cmkr::help::message();
}

@ -54,8 +54,10 @@ class TomlChecker {
tsl::ordered_set<toml::key> m_conditionVisited;
public:
TomlChecker(const TomlBasicValue &v, const toml::key &ky) : m_v(toml::find(v, ky)) {}
TomlChecker(const TomlBasicValue &v) : m_v(v) {}
TomlChecker(const TomlBasicValue &v, const toml::key &ky) : m_v(toml::find(v, ky)) {
}
TomlChecker(const TomlBasicValue &v) : m_v(v) {
}
TomlChecker(const TomlChecker &) = delete;
TomlChecker(TomlChecker &&) = delete;
@ -109,9 +111,13 @@ class TomlChecker {
return toml::find(m_v, ky);
}
void visit(const toml::key &ky) { m_visited.emplace(ky); }
void visit(const toml::key &ky) {
m_visited.emplace(ky);
}
bool visisted(const toml::key &ky) const { return m_visited.contains(ky); }
bool visisted(const toml::key &ky) const {
return m_visited.contains(ky);
}
void check(const tsl::ordered_map<std::string, std::string> &conditions) const {
for (const auto &itr : m_v.as_table()) {
@ -152,7 +158,8 @@ class TomlCheckerRoot {
bool m_checked = false;
public:
TomlCheckerRoot(const TomlBasicValue &root) : m_root(root) {}
TomlCheckerRoot(const TomlBasicValue &root) : m_root(root) {
}
TomlCheckerRoot(const TomlCheckerRoot &) = delete;
TomlCheckerRoot(TomlCheckerRoot &&) = delete;

Loading…
Cancel
Save