diff --git a/.clang-tidy b/.clang-tidy index ceec6c43..a584c6ce 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,5 +1,5 @@ --- -Checks: '-*,performance-*,readability-*,modernize-use-*,-modernize-raw-string-literal,-modernize-use-bool-literals,-readability-implicit-bool-cast,-readability-else-after-return,-readability-named-parameter' +Checks: '-*,performance-*,readability-*,modernize-use-*,modernize-*,-modernize-raw-string-literal,-modernize-use-bool-literals,-readability-implicit-bool-cast,-readability-else-after-return,-readability-named-parameter' CheckOptions: - key: modernize-loop-convert.NamingStyle value: lower_case diff --git a/include/adapters/alsa/control.hpp b/include/adapters/alsa/control.hpp index 4e964af0..27c18091 100644 --- a/include/adapters/alsa/control.hpp +++ b/include/adapters/alsa/control.hpp @@ -20,13 +20,16 @@ namespace alsa { explicit control(int numid); ~control(); + control(const control& o) = delete; + control& operator=(const control& o) = delete; + int get_numid(); bool wait(int timeout = -1); bool test_device_plugged(); void process_events(); private: - std::mutex m_lock; + std::mutex m_lock{}; int m_numid{0}; diff --git a/include/adapters/alsa/mixer.hpp b/include/adapters/alsa/mixer.hpp index 748036b2..b6cc3f42 100644 --- a/include/adapters/alsa/mixer.hpp +++ b/include/adapters/alsa/mixer.hpp @@ -20,6 +20,9 @@ namespace alsa { explicit mixer(string&& mixer_selem_name); ~mixer(); + mixer(const mixer& o) = delete; + mixer& operator=(const mixer& o) = delete; + const string& get_name(); bool wait(int timeout = -1); @@ -34,7 +37,7 @@ namespace alsa { bool is_muted(); private: - std::mutex m_lock; + std::mutex m_lock{}; snd_mixer_t* m_mixer{nullptr}; snd_mixer_elem_t* m_elem{nullptr}; diff --git a/include/adapters/mpd.hpp b/include/adapters/mpd.hpp index 26877ca2..2ccb590b 100644 --- a/include/adapters/mpd.hpp +++ b/include/adapters/mpd.hpp @@ -112,7 +112,7 @@ namespace mpd { private: const logger& m_log; - mpd_connection_t m_connection; + mpd_connection_t m_connection{}; bool m_listactive = false; bool m_idle = false; @@ -151,21 +151,21 @@ namespace mpd { int get_seek_position(int percentage); private: - mpd_status_t m_status; - unique_ptr m_song; - mpdstate m_state = mpdstate::UNKNOWN; - chrono::system_clock::time_point m_updated_at; + mpd_status_t m_status{}; + unique_ptr m_song{}; + mpdstate m_state{mpdstate::UNKNOWN}; + chrono::system_clock::time_point m_updated_at{}; - bool m_random = false; - bool m_repeat = false; - bool m_single = false; + bool m_random{false}; + bool m_repeat{false}; + bool m_single{false}; - int m_songid; - int m_queuelen; + int m_songid{0}; + int m_queuelen{0}; - unsigned long m_total_time; - unsigned long m_elapsed_time; - unsigned long m_elapsed_time_ms; + unsigned long m_total_time{0UL}; + unsigned long m_elapsed_time{0UL}; + unsigned long m_elapsed_time_ms{0UL}; }; // }}} diff --git a/include/adapters/net.hpp b/include/adapters/net.hpp index ea0f91dc..ac966bba 100644 --- a/include/adapters/net.hpp +++ b/include/adapters/net.hpp @@ -111,8 +111,8 @@ namespace net { void query_quality(const int& socket_fd); private: - shared_ptr m_info; - string m_essid; + shared_ptr m_info{}; + string m_essid{}; quality_range m_signalstrength{}; quality_range m_linkquality{}; }; diff --git a/include/components/bar.hpp b/include/components/bar.hpp index 62fbe7ff..37e7e1f9 100644 --- a/include/components/bar.hpp +++ b/include/components/bar.hpp @@ -1,6 +1,7 @@ #pragma once #include "common.hpp" +#include "components/renderer.hpp" #include "components/screen.hpp" #include "components/types.hpp" #include "errors.hpp" @@ -20,7 +21,6 @@ POLYBAR_NS class screen; class tray_manager; class logger; -class renderer; class bar : public xpp::event::sink { public: @@ -58,9 +58,9 @@ class bar : public xpp::event::sink m_tags{ // clang-format off @@ -97,8 +97,8 @@ class builder { uint8_t m_attributes{static_cast(attribute::NONE)}; uint8_t m_fontindex{1}; - string m_background; - string m_foreground; + string m_background{}; + string m_foreground{}; }; POLYBAR_NS_END diff --git a/include/components/command_line.hpp b/include/components/command_line.hpp index 72277cf4..40f4e2e0 100644 --- a/include/components/command_line.hpp +++ b/include/components/command_line.hpp @@ -58,10 +58,10 @@ namespace command_line { void parse(const string& input, const string& input_next = ""); private: - string m_synopsis; + string m_synopsis{}; const options m_opts; - values m_optvalues; - bool m_skipnext = false; + values m_optvalues{}; + bool m_skipnext{false}; }; // }}} diff --git a/include/components/config.hpp b/include/components/config.hpp index af67f170..a49539e6 100644 --- a/include/components/config.hpp +++ b/include/components/config.hpp @@ -302,7 +302,7 @@ class config { const xresource_manager& m_xrm; string m_file; string m_barname; - sectionmap_t m_sections; + sectionmap_t m_sections{}; }; POLYBAR_NS_END diff --git a/include/components/eventloop.hpp b/include/components/eventloop.hpp index f09a9d02..08aa4342 100644 --- a/include/components/eventloop.hpp +++ b/include/components/eventloop.hpp @@ -1,6 +1,7 @@ #pragma once #include + #include #include #include @@ -60,7 +61,7 @@ class eventloop : public signal_receiver borders; + std::unordered_map borders{}; uint8_t spacing{1U}; - string separator; + string separator{}; - string wmname; - string locale; + string wmname{}; + string locale{}; bool override_redirect{false}; - vector actions; + vector actions{}; const xcb_rectangle_t inner_area(bool abspos = false) const { xcb_rectangle_t rect{0, 0, size.w, size.h}; diff --git a/include/drawtypes/label.hpp b/include/drawtypes/label.hpp index dd79ac12..fe82eed4 100644 --- a/include/drawtypes/label.hpp +++ b/include/drawtypes/label.hpp @@ -30,15 +30,15 @@ namespace drawtypes { class label : public non_copyable_mixin