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-magic-numbers,
-readability-make-member-function-const,
-readability-named-parameter,
-readability-redundant-access-specifiers,
-readability-redundant-string-init,
-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);
return traits;
}
void set_unit_of_measurement(const char *);
void set_unit_of_measurement(const char *unit);
protected:
std::unique_ptr<AnovaCodec> codec_;

View file

@ -52,7 +52,7 @@ template<typename... Ts> class UserServiceBase : public UserServiceDescriptor {
protected:
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]))...);
}

View file

@ -44,8 +44,8 @@ class HM3301Component : public PollingComponent, public i2c::I2CDevice {
AQICalculatorType aqi_calc_type_;
AQICalculatorFactory aqi_calculator_factory_ = AQICalculatorFactory();
bool validate_checksum_(const uint8_t *);
uint16_t get_sensor_value_(const uint8_t *, uint8_t);
bool validate_checksum_(const uint8_t *data);
uint16_t get_sensor_value_(const uint8_t *data, uint8_t i);
};
} // 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) {
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_() {

View file

@ -440,7 +440,7 @@ ModbusCommandItem ModbusCommandItem::create_custom_command(
cmd.modbusdevice = modbusdevice;
cmd.function_code = ModbusFunctionCode::CUSTOM;
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");
};
} else {

View file

@ -26,7 +26,6 @@ class ModbusNumber : public number::Number, public Component, public SensorItem
void dump_config() override;
void parse_and_publish(const std::vector<uint8_t> &data) override;
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_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);
protected:
void send_cmd_(const std::string &);
void parse_cmd_(std::string);
void send_cmd_(const std::string &message);
void parse_cmd_(std::string message);
std::string sender_;
char read_buffer_[SIM800L_READ_BUFFER_LENGTH];

View file

@ -21,9 +21,9 @@ class TM1651Display : public Component {
void setup() override;
void dump_config() override;
void set_level_percent(uint8_t);
void set_level(uint8_t);
void set_brightness(uint8_t);
void set_level_percent(uint8_t new_level);
void set_level(uint8_t new_level);
void set_brightness(uint8_t new_brightness);
void turn_on();
void turn_off();
@ -39,8 +39,8 @@ class TM1651Display : public Component {
void repaint_();
uint8_t calculate_level_(uint8_t);
uint8_t calculate_brightness_(uint8_t);
uint8_t calculate_level_(uint8_t new_level);
uint8_t calculate_brightness_(uint8_t new_brightness);
};
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_();
#endif
#ifdef USE_ESP_IDF
void wifi_process_event_(IDFWiFiEvent *);
void wifi_process_event_(IDFWiFiEvent *data);
#endif
std::string use_address_;