mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
[clang-tidy] Remove redundant const
Found with readability-const-return-type Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
7f86b29aa9
commit
55d103c491
12 changed files with 36 additions and 36 deletions
10
src/CLI2.cpp
10
src/CLI2.cpp
|
@ -90,7 +90,7 @@ void A2::attribute (const std::string& name, const std::string& value)
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Accessor for attributes.
|
||||
const std::string A2::attribute (const std::string& name) const
|
||||
std::string A2::attribute (const std::string& name) const
|
||||
{
|
||||
// Prevent autovivification.
|
||||
auto i = _attributes.find (name);
|
||||
|
@ -101,7 +101,7 @@ const std::string A2::attribute (const std::string& name) const
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::string A2::getToken () const
|
||||
std::string A2::getToken () const
|
||||
{
|
||||
auto i = _attributes.find ("canonical");
|
||||
if (i == _attributes.end ())
|
||||
|
@ -175,7 +175,7 @@ void A2::decompose ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::string A2::dump () const
|
||||
std::string A2::dump () const
|
||||
{
|
||||
auto output = Lexer::typeToString (_lextype);
|
||||
|
||||
|
@ -638,7 +638,7 @@ void CLI2::prepareFilter ()
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Return all the MISCELLANEOUS args.
|
||||
const std::vector <std::string> CLI2::getWords ()
|
||||
std::vector <std::string> CLI2::getWords ()
|
||||
{
|
||||
std::vector <std::string> words;
|
||||
for (const auto& a : _args)
|
||||
|
@ -710,7 +710,7 @@ std::string CLI2::getCommand (bool canonical) const
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::string CLI2::dump (const std::string& title) const
|
||||
std::string CLI2::dump (const std::string& title) const
|
||||
{
|
||||
std::stringstream out;
|
||||
|
||||
|
|
10
src/CLI2.h
10
src/CLI2.h
|
@ -43,9 +43,9 @@ public:
|
|||
void tag (const std::string&);
|
||||
void unTag (const std::string&);
|
||||
void attribute (const std::string&, const std::string&);
|
||||
const std::string attribute (const std::string&) const;
|
||||
const std::string getToken () const;
|
||||
const std::string dump () const;
|
||||
std::string attribute (const std::string&) const;
|
||||
std::string getToken () const;
|
||||
std::string dump () const;
|
||||
void decompose ();
|
||||
|
||||
public:
|
||||
|
@ -75,11 +75,11 @@ public:
|
|||
void addFilter (const std::string& arg);
|
||||
void addContextFilter ();
|
||||
void prepareFilter ();
|
||||
const std::vector <std::string> getWords ();
|
||||
std::vector <std::string> getWords ();
|
||||
bool canonicalize (std::string&, const std::string&, const std::string&) const;
|
||||
std::string getBinary () const;
|
||||
std::string getCommand (bool canonical = true) const;
|
||||
const std::string dump (const std::string& title = "CLI2 Parser") const;
|
||||
std::string dump (const std::string& title = "CLI2 Parser") const;
|
||||
|
||||
private:
|
||||
void handleArg0 ();
|
||||
|
|
|
@ -1006,7 +1006,7 @@ bool Context::verbose (const std::string& token)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::vector <std::string> Context::getColumns () const
|
||||
std::vector <std::string> Context::getColumns () const
|
||||
{
|
||||
std::vector <std::string> output;
|
||||
for (auto& col : columns)
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
int getWidth (); // determine terminal width
|
||||
int getHeight (); // determine terminal height
|
||||
|
||||
const std::vector <std::string> getColumns () const;
|
||||
std::vector <std::string> getColumns () const;
|
||||
void getLimits (int&, int&);
|
||||
|
||||
bool color (); // TTY or <other>?
|
||||
|
|
|
@ -114,7 +114,7 @@ std::vector <std::string> Lexer::split (const std::string& text)
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// No L10N - these are for internal purposes.
|
||||
const std::string Lexer::typeName (const Lexer::Type& type)
|
||||
std::string Lexer::typeName (const Lexer::Type& type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
static std::string typeToString (Lexer::Type);
|
||||
|
||||
// Static helpers.
|
||||
static const std::string typeName (const Lexer::Type&);
|
||||
static std::string typeName (const Lexer::Type&);
|
||||
static bool isIdentifierStart (int);
|
||||
static bool isIdentifierNext (int);
|
||||
static bool isSingleCharOperator (int);
|
||||
|
|
|
@ -555,7 +555,7 @@ void TF2::dependency_scan ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::string TF2::dump ()
|
||||
std::string TF2::dump ()
|
||||
{
|
||||
Color red ("rgb500 on rgb100");
|
||||
Color yellow ("rgb550 on rgb220");
|
||||
|
@ -1307,7 +1307,7 @@ int TDB2::latest_id ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::vector <Task> TDB2::all_tasks ()
|
||||
std::vector <Task> TDB2::all_tasks ()
|
||||
{
|
||||
std::vector <Task> all (pending._tasks.size () +
|
||||
pending._added_tasks.size () +
|
||||
|
@ -1350,7 +1350,7 @@ bool TDB2::has (const std::string& uuid)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::vector <Task> TDB2::siblings (Task& task)
|
||||
std::vector <Task> TDB2::siblings (Task& task)
|
||||
{
|
||||
std::vector <Task> results;
|
||||
if (task.has ("parent"))
|
||||
|
@ -1385,7 +1385,7 @@ const std::vector <Task> TDB2::siblings (Task& task)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::vector <Task> TDB2::children (Task& task)
|
||||
std::vector <Task> TDB2::children (Task& task)
|
||||
{
|
||||
std::vector <Task> results;
|
||||
std::string parent = task.get ("uuid");
|
||||
|
|
|
@ -72,7 +72,7 @@ public:
|
|||
void has_ids ();
|
||||
void auto_dep_scan ();
|
||||
void clear ();
|
||||
const std::string dump ();
|
||||
std::string dump ();
|
||||
|
||||
void dependency_scan ();
|
||||
|
||||
|
@ -121,12 +121,12 @@ public:
|
|||
int latest_id ();
|
||||
|
||||
// Generalized task accessors.
|
||||
const std::vector <Task> all_tasks ();
|
||||
std::vector <Task> all_tasks ();
|
||||
bool get (int, Task&);
|
||||
bool get (const std::string&, Task&);
|
||||
bool has (const std::string&);
|
||||
const std::vector <Task> siblings (Task&);
|
||||
const std::vector <Task> children (Task&);
|
||||
std::vector <Task> siblings (Task&);
|
||||
std::vector <Task> children (Task&);
|
||||
|
||||
// ID <--> UUID mapping.
|
||||
std::string uuid (int);
|
||||
|
|
|
@ -167,7 +167,7 @@ std::string Task::statusToText (Task::status s)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Returns a proper handle to the task. Tasks should not be referenced by UUIDs
|
||||
// as long as they have non-zero ID.
|
||||
const std::string Task::identifier (bool shortened /* = false */) const
|
||||
std::string Task::identifier (bool shortened /* = false */) const
|
||||
{
|
||||
if (id != 0)
|
||||
return format (id);
|
||||
|
@ -207,7 +207,7 @@ std::vector <std::string> Task::all ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::string Task::get (const std::string& name) const
|
||||
std::string Task::get (const std::string& name) const
|
||||
{
|
||||
auto i = data.find (name);
|
||||
if (i != data.end ())
|
||||
|
@ -1695,7 +1695,7 @@ void Task::validate_before (const std::string& left, const std::string& right)
|
|||
// Encode values prior to serialization.
|
||||
// [ -> &open;
|
||||
// ] -> &close;
|
||||
const std::string Task::encode (const std::string& value) const
|
||||
std::string Task::encode (const std::string& value) const
|
||||
{
|
||||
auto modified = str_replace (value, "[", "&open;");
|
||||
return str_replace (modified, "]", "&close;");
|
||||
|
@ -1705,7 +1705,7 @@ const std::string Task::encode (const std::string& value) const
|
|||
// Decode values after parse.
|
||||
// [ <- &open;
|
||||
// ] <- &close;
|
||||
const std::string Task::decode (const std::string& value) const
|
||||
std::string Task::decode (const std::string& value) const
|
||||
{
|
||||
if (value.find ('&') == std::string::npos)
|
||||
return value;
|
||||
|
|
|
@ -89,8 +89,8 @@ public:
|
|||
void setAsNow (const std::string&);
|
||||
bool has (const std::string&) const;
|
||||
std::vector <std::string> all ();
|
||||
const std::string identifier (bool shortened = false) const;
|
||||
const std::string get (const std::string&) const;
|
||||
std::string identifier (bool shortened = false) const;
|
||||
std::string get (const std::string&) const;
|
||||
const std::string& get_ref (const std::string&) const;
|
||||
int get_int (const std::string&) const;
|
||||
unsigned long get_ulong (const std::string&) const;
|
||||
|
@ -168,8 +168,8 @@ private:
|
|||
void parseJSON (const json::object*);
|
||||
void parseLegacy (const std::string&);
|
||||
void validate_before (const std::string&, const std::string&);
|
||||
const std::string encode (const std::string&) const;
|
||||
const std::string decode (const std::string&) const;
|
||||
std::string encode (const std::string&) const;
|
||||
std::string decode (const std::string&) const;
|
||||
|
||||
public:
|
||||
float urgency_project () const;
|
||||
|
|
|
@ -159,7 +159,7 @@ void uuid_unparse_lower (uuid_t uu, char *out)
|
|||
}
|
||||
#endif
|
||||
|
||||
const std::string uuid ()
|
||||
std::string uuid ()
|
||||
{
|
||||
uuid_t id;
|
||||
uuid_generate (id);
|
||||
|
@ -198,7 +198,7 @@ const std::string uuid ()
|
|||
// - delimiter is the character used to split up projects into subprojects.
|
||||
// - defaults to the period, '.'
|
||||
//
|
||||
const std::string indentProject (
|
||||
std::string indentProject (
|
||||
const std::string& project,
|
||||
const std::string& whitespace /* = " " */,
|
||||
char delimiter /* = '.' */)
|
||||
|
@ -226,7 +226,7 @@ const std::string indentProject (
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::vector <std::string> extractParents (
|
||||
std::vector <std::string> extractParents (
|
||||
const std::string& project,
|
||||
const char& delimiter /* = '.' */)
|
||||
{
|
||||
|
|
|
@ -45,14 +45,14 @@ int confirm4 (const std::string&);
|
|||
#ifndef HAVE_UUID_UNPARSE_LOWER
|
||||
void uuid_unparse_lower (uuid_t uu, char *out);
|
||||
#endif
|
||||
const std::string uuid ();
|
||||
std::string uuid ();
|
||||
|
||||
const std::string indentProject (
|
||||
std::string indentProject (
|
||||
const std::string&,
|
||||
const std::string& whitespace = " ",
|
||||
char delimiter = '.');
|
||||
|
||||
const std::vector <std::string> extractParents (
|
||||
std::vector <std::string> extractParents (
|
||||
const std::string&,
|
||||
const char& delimiter = '.');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue