Enable readability-named-parameter check (#3098)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Oxan van Leeuwen 2022-01-23 08:39:07 +01:00 committed by GitHub
parent 7da12a878f
commit b2430097f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 14 additions and 16 deletions

View file

@ -76,7 +76,6 @@ Checks: >-
-readability-isolate-declaration, -readability-isolate-declaration,
-readability-magic-numbers, -readability-magic-numbers,
-readability-make-member-function-const, -readability-make-member-function-const,
-readability-named-parameter,
-readability-redundant-access-specifiers, -readability-redundant-access-specifiers,
-readability-redundant-string-init, -readability-redundant-string-init,
-readability-uppercase-literal-suffix, -readability-uppercase-literal-suffix,

View file

@ -36,7 +36,7 @@ class Anova : public climate::Climate, public esphome::ble_client::BLEClientNode
traits.set_visual_temperature_step(0.1); traits.set_visual_temperature_step(0.1);
return traits; return traits;
} }
void set_unit_of_measurement(const char *); void set_unit_of_measurement(const char *unit);
protected: protected:
std::unique_ptr<AnovaCodec> codec_; std::unique_ptr<AnovaCodec> codec_;

View file

@ -52,7 +52,7 @@ template<typename... Ts> class UserServiceBase : public UserServiceDescriptor {
protected: protected:
virtual void execute(Ts... x) = 0; virtual void execute(Ts... x) = 0;
template<int... S> void execute_(std::vector<ExecuteServiceArgument> args, seq<S...>) { template<int... S> void execute_(std::vector<ExecuteServiceArgument> args, seq<S...> type) {
this->execute((get_execute_arg_value<Ts>(args[S]))...); this->execute((get_execute_arg_value<Ts>(args[S]))...);
} }

View file

@ -44,8 +44,8 @@ class HM3301Component : public PollingComponent, public i2c::I2CDevice {
AQICalculatorType aqi_calc_type_; AQICalculatorType aqi_calc_type_;
AQICalculatorFactory aqi_calculator_factory_ = AQICalculatorFactory(); AQICalculatorFactory aqi_calculator_factory_ = AQICalculatorFactory();
bool validate_checksum_(const uint8_t *); bool validate_checksum_(const uint8_t *data);
uint16_t get_sensor_value_(const uint8_t *, uint8_t); uint16_t get_sensor_value_(const uint8_t *data, uint8_t i);
}; };
} // namespace hm3301 } // namespace hm3301

View file

@ -28,7 +28,7 @@ void KalmanCombinatorComponent::add_source(Sensor *sensor, std::function<float(f
} }
void KalmanCombinatorComponent::add_source(Sensor *sensor, float stddev) { void KalmanCombinatorComponent::add_source(Sensor *sensor, float stddev) {
this->add_source(sensor, std::function<float(float)>{[stddev](float) -> float { return stddev; }}); this->add_source(sensor, std::function<float(float)>{[stddev](float x) -> float { return stddev; }});
} }
void KalmanCombinatorComponent::update_variance_() { void KalmanCombinatorComponent::update_variance_() {

View file

@ -440,7 +440,7 @@ ModbusCommandItem ModbusCommandItem::create_custom_command(
cmd.modbusdevice = modbusdevice; cmd.modbusdevice = modbusdevice;
cmd.function_code = ModbusFunctionCode::CUSTOM; cmd.function_code = ModbusFunctionCode::CUSTOM;
if (handler == nullptr) { if (handler == nullptr) {
cmd.on_data_func = [](ModbusRegisterType, uint16_t, const std::vector<uint8_t> &data) { cmd.on_data_func = [](ModbusRegisterType register_type, uint16_t start_address, const std::vector<uint8_t> &data) {
ESP_LOGI(TAG, "Custom Command sent"); ESP_LOGI(TAG, "Custom Command sent");
}; };
} else { } else {

View file

@ -26,7 +26,6 @@ class ModbusNumber : public number::Number, public Component, public SensorItem
void dump_config() override; void dump_config() override;
void parse_and_publish(const std::vector<uint8_t> &data) override; void parse_and_publish(const std::vector<uint8_t> &data) override;
float get_setup_priority() const override { return setup_priority::HARDWARE; } float get_setup_priority() const override { return setup_priority::HARDWARE; }
void set_update_interval(int) {}
void set_parent(ModbusController *parent) { this->parent_ = parent; } void set_parent(ModbusController *parent) { this->parent_ = parent; }
void set_write_multiply(float factor) { multiply_by_ = factor; } void set_write_multiply(float factor) { multiply_by_ = factor; }

View file

@ -49,8 +49,8 @@ class Sim800LComponent : public uart::UARTDevice, public PollingComponent {
void dial(const std::string &recipient); void dial(const std::string &recipient);
protected: protected:
void send_cmd_(const std::string &); void send_cmd_(const std::string &message);
void parse_cmd_(std::string); void parse_cmd_(std::string message);
std::string sender_; std::string sender_;
char read_buffer_[SIM800L_READ_BUFFER_LENGTH]; char read_buffer_[SIM800L_READ_BUFFER_LENGTH];

View file

@ -21,9 +21,9 @@ class TM1651Display : public Component {
void setup() override; void setup() override;
void dump_config() override; void dump_config() override;
void set_level_percent(uint8_t); void set_level_percent(uint8_t new_level);
void set_level(uint8_t); void set_level(uint8_t new_level);
void set_brightness(uint8_t); void set_brightness(uint8_t new_brightness);
void turn_on(); void turn_on();
void turn_off(); void turn_off();
@ -39,8 +39,8 @@ class TM1651Display : public Component {
void repaint_(); void repaint_();
uint8_t calculate_level_(uint8_t); uint8_t calculate_level_(uint8_t new_level);
uint8_t calculate_brightness_(uint8_t); uint8_t calculate_brightness_(uint8_t new_brightness);
}; };
template<typename... Ts> class SetLevelPercentAction : public Action<Ts...>, public Parented<TM1651Display> { template<typename... Ts> class SetLevelPercentAction : public Action<Ts...>, public Parented<TM1651Display> {

View file

@ -299,7 +299,7 @@ class WiFiComponent : public Component {
void wifi_scan_done_callback_(); void wifi_scan_done_callback_();
#endif #endif
#ifdef USE_ESP_IDF #ifdef USE_ESP_IDF
void wifi_process_event_(IDFWiFiEvent *); void wifi_process_event_(IDFWiFiEvent *data);
#endif #endif
std::string use_address_; std::string use_address_;