Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexays committed Sep 13, 2024
1 parent 64d99a5 commit 6417782
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 34 deletions.
1 change: 1 addition & 0 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ jobs:
with:
source: "."
extensions: "hpp,h,cpp,c"
style: "file:.clang-format"
clangFormatVersion: 16
2 changes: 1 addition & 1 deletion include/AModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AModule : public IModule {

~AModule() override;
auto update() -> void override;
virtual auto refresh(int shouldRefresh) -> void{};
virtual auto refresh(int shouldRefresh) -> void {};
operator Gtk::Widget &() override;
auto doAction(const std::string &name) -> void override;

Expand Down
4 changes: 2 additions & 2 deletions include/modules/clock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class Clock final : public ALabel {
day cldBaseDay_{0}; // calendar Cached day. Is used when today is changing(midnight)
std::string cldText_{""}; // calendar text to print
CldMode cldMode_{CldMode::MONTH};
auto get_calendar(const year_month_day& today, const year_month_day& ymd, const time_zone* tz)
-> const std::string;
auto get_calendar(const year_month_day& today, const year_month_day& ymd,
const time_zone* tz) -> const std::string;

// get local time zone
auto local_zone() -> const time_zone*;
Expand Down
4 changes: 2 additions & 2 deletions include/modules/hyprland/workspaces.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class Workspaces : public AModule, public EventHandler {
// Config
void parseConfig(const Json::Value& config);
auto populateIconsMap(const Json::Value& formatIcons) -> void;
static auto populateBoolConfig(const Json::Value& config, const std::string& key, bool& member)
-> void;
static auto populateBoolConfig(const Json::Value& config, const std::string& key,
bool& member) -> void;
auto populateSortByConfig(const Json::Value& config) -> void;
auto populateIgnoreWorkspacesConfig(const Json::Value& config) -> void;
auto populateFormatWindowSeparatorConfig(const Json::Value& config) -> void;
Expand Down
12 changes: 6 additions & 6 deletions include/util/clara.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,8 @@ inline auto convertInto(std::string const &source, bool &target) -> ParserResult
}
#ifdef CLARA_CONFIG_OPTIONAL_TYPE
template <typename T>
inline auto convertInto(std::string const &source, CLARA_CONFIG_OPTIONAL_TYPE<T> &target)
-> ParserResult {
inline auto convertInto(std::string const &source,
CLARA_CONFIG_OPTIONAL_TYPE<T> &target) -> ParserResult {
T temp;
auto result = convertInto(source, temp);
if (result) target = std::move(temp);
Expand Down Expand Up @@ -751,8 +751,8 @@ class ParserBase {
public:
virtual ~ParserBase() = default;
virtual auto validate() const -> Result { return Result::ok(); }
virtual auto parse(std::string const &exeName, TokenStream const &tokens) const
-> InternalParseResult = 0;
virtual auto parse(std::string const &exeName,
TokenStream const &tokens) const -> InternalParseResult = 0;
virtual auto cardinality() const -> size_t { return 1; }

auto parse(Args const &args) const -> InternalParseResult {
Expand Down Expand Up @@ -1098,8 +1098,8 @@ struct Parser : ParserBase {

using ParserBase::parse;

auto parse(std::string const &exeName, TokenStream const &tokens) const
-> InternalParseResult override {
auto parse(std::string const &exeName,
TokenStream const &tokens) const -> InternalParseResult override {
struct ParserInfo {
ParserBase const *parser = nullptr;
size_t count = 0;
Expand Down
2 changes: 1 addition & 1 deletion include/util/format.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class pow_format {
public:
pow_format(long long val, std::string&& unit, bool binary = false)
: val_(val), unit_(unit), binary_(binary){};
: val_(val), unit_(unit), binary_(binary) {};

long long val_;
std::string unit_;
Expand Down
17 changes: 8 additions & 9 deletions src/modules/bluetooth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ auto getBoolProperty(GDBusProxy* proxy, const char* property_name) -> bool {
return false;
}

auto getOptionalStringProperty(GDBusProxy* proxy, const char* property_name)
-> std::optional<std::string> {
auto getOptionalStringProperty(GDBusProxy* proxy,
const char* property_name) -> std::optional<std::string> {
auto gvar = g_dbus_proxy_get_cached_property(proxy, property_name);
if (gvar) {
std::string property_value = g_variant_get_string(gvar, NULL);
Expand Down Expand Up @@ -345,8 +345,8 @@ auto waybar::modules::Bluetooth::onInterfaceAddedOrRemoved(GDBusObjectManager* m

auto waybar::modules::Bluetooth::onInterfaceProxyPropertiesChanged(
GDBusObjectManagerClient* manager, GDBusObjectProxy* object_proxy, GDBusProxy* interface_proxy,
GVariant* changed_properties, const gchar* const* invalidated_properties, gpointer user_data)
-> void {
GVariant* changed_properties, const gchar* const* invalidated_properties,
gpointer user_data) -> void {
std::string interface_name = g_dbus_proxy_get_interface_name(interface_proxy);
std::string object_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object_proxy));

Expand Down Expand Up @@ -395,8 +395,8 @@ auto waybar::modules::Bluetooth::getDeviceBatteryPercentage(GDBusObject* object)
return std::nullopt;
}

auto waybar::modules::Bluetooth::getDeviceProperties(GDBusObject* object, DeviceInfo& device_info)
-> bool {
auto waybar::modules::Bluetooth::getDeviceProperties(GDBusObject* object,
DeviceInfo& device_info) -> bool {
GDBusProxy* proxy_device = G_DBUS_PROXY(g_dbus_object_get_interface(object, "org.bluez.Device1"));

if (proxy_device != NULL) {
Expand Down Expand Up @@ -462,9 +462,8 @@ auto waybar::modules::Bluetooth::findCurController() -> std::optional<Controller
return controller_info;
}

auto waybar::modules::Bluetooth::findConnectedDevices(const std::string& cur_controller_path,
std::vector<DeviceInfo>& connected_devices)
-> void {
auto waybar::modules::Bluetooth::findConnectedDevices(
const std::string& cur_controller_path, std::vector<DeviceInfo>& connected_devices) -> void {
GList* objects = g_dbus_object_manager_get_objects(manager_.get());
for (GList* l = objects; l != NULL; l = l->next) {
GDBusObject* object = G_DBUS_OBJECT(l->data);
Expand Down
4 changes: 2 additions & 2 deletions src/modules/clock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ const unsigned cldRowsInMonth(const year_month& ym, const weekday& firstdow) {
return 2u + ceil<weeks>((weekday{ym / 1} - firstdow) + ((ym / last).day() - day{0})).count();
}

auto cldGetWeekForLine(const year_month& ym, const weekday& firstdow, const unsigned line)
-> const year_month_weekday {
auto cldGetWeekForLine(const year_month& ym, const weekday& firstdow,
const unsigned line) -> const year_month_weekday {
unsigned index{line - 2};
if (weekday{ym / 1} == firstdow) ++index;
return ym / firstdow[index];
Expand Down
4 changes: 2 additions & 2 deletions src/modules/dwl/tags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ static void set_layout(void *data, zdwl_ipc_output_v2 *zdwl_output_v2, uint32_t
// Intentionally empty
}

static void appid(void *data, zdwl_ipc_output_v2 *zdwl_output_v2, const char *appid){
// Intentionally empty
static void appid(void *data, zdwl_ipc_output_v2 *zdwl_output_v2, const char *appid) {
// Intentionally empty
};

static const zdwl_ipc_output_v2_listener output_status_listener_impl{
Expand Down
4 changes: 2 additions & 2 deletions src/modules/hyprland/workspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,8 @@ auto Workspaces::populateIconsMap(const Json::Value &formatIcons) -> void {
m_iconsMap.emplace("", "");
}

auto Workspaces::populateBoolConfig(const Json::Value &config, const std::string &key, bool &member)
-> void {
auto Workspaces::populateBoolConfig(const Json::Value &config, const std::string &key,
bool &member) -> void {
const auto &configValue = config[key];
if (configValue.isBool()) {
member = configValue.asBool();
Expand Down
8 changes: 4 additions & 4 deletions src/modules/memory/bsd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ static uint64_t get_total_memory() {
u_long physmem;
#endif
int mib[] = {
CTL_HW,
CTL_HW,
#if defined(HW_MEMSIZE)
HW_MEMSIZE,
HW_MEMSIZE,
#elif defined(HW_PHYSMEM64)
HW_PHYSMEM64,
HW_PHYSMEM64,
#else
HW_PHYSMEM,
HW_PHYSMEM,
#endif
};
u_int miblen = sizeof(mib) / sizeof(mib[0]);
Expand Down
4 changes: 2 additions & 2 deletions src/modules/wlr/workspace_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ auto WorkspaceManager::sort_workspaces() -> void {
}
}

auto WorkspaceManager::register_manager(wl_registry *registry, uint32_t name, uint32_t version)
-> void {
auto WorkspaceManager::register_manager(wl_registry *registry, uint32_t name,
uint32_t version) -> void {
if (workspace_manager_) {
spdlog::warn("Register workspace manager again although already registered!");
return;
Expand Down
2 changes: 1 addition & 1 deletion test/utils/SafeSignal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct TestObject {
unsigned copied = 0;
unsigned moved = 0;

TestObject(const T& v) : value(v){};
TestObject(const T& v) : value(v) {};
~TestObject() = default;

TestObject(const TestObject& other)
Expand Down

0 comments on commit 6417782

Please sign in to comment.