Skip to content

Commit 94a2fe5

Browse files
committed
clang_tidy, and codacy fixes
1 parent a2ef17d commit 94a2fe5

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

include/CLI/Option.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ class Option : public OptionBase<Option> {
690690
/// Use `get_name(true)` to get the positional name (replaces `get_pname`)
691691
std::string get_name(bool positional = false, //<[input] Show the positional name
692692
bool all_options = false //<[input] Show every option
693-
) const {
693+
) const {
694694

695695
if(all_options) {
696696

@@ -935,7 +935,7 @@ class Option : public OptionBase<Option> {
935935
res = std::move(extra);
936936
}
937937
} else {
938-
res.push_back(std::string{});
938+
res.emplace_back();
939939
}
940940
} else {
941941
res = reduced_results();

include/CLI/TypeTools.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ bool lexical_conversion(const std::vector<std ::string> &strings, T &output) {
900900
retval = retval && lexical_conversion<typename T::value_type, typename XC::value_type>(temp, output.back());
901901
temp.clear();
902902
if(!retval) {
903-
return retval;
903+
return false;
904904
}
905905
icount = 0;
906906
}

tests/app_helper.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "gtest/gtest.h"
1010
#include <iostream>
1111

12-
typedef std::vector<std::string> input_t;
12+
using input_t= std::vector<std::string>;
1313

1414
struct TApp : public ::testing::Test {
1515
CLI::App app{"My Test Program"};
@@ -27,7 +27,7 @@ class TempFile {
2727
std::string _name;
2828

2929
public:
30-
explicit TempFile(std::string name) : _name(name) {
30+
explicit TempFile(std::string name) : _name(std::move(name)) {
3131
if(!CLI::NonexistentPath(_name).empty())
3232
throw std::runtime_error(_name);
3333
}

0 commit comments

Comments
 (0)