Unverified Commit ad00f750 authored by DannyHindson's avatar DannyHindson Committed by GitHub
Browse files

Merge pull request #32401 from DavidFair/clang_tidy_refs

Clang tidy refs
parents f77036d6 b92bb873
# Yaml file format
Checks: >
*,
-abseil-*,-android-*,-altera-*,-fuchsia-*,-llvmlibc-*,-objc-*,
-google-build-using-namespace,
-google-readability-braces-around-statements,-hicpp-braces-around-statements,-readability-braces-around-statements,
-modernize-use-trailing-return-type,
-readability-implicit-bool-conversion
# Skip the following family of checks (for perf as we don't touch these libs at all):
# abseil-*
# android-*
# altera-*
# fuchsia-*
# llvmlibc-*
# objc-*
# The following checks are additionally disabled above:
# -google-build-using-namespace Useful for headers, but we can't filter out .cpp where it's used frequently
# -google-readability-braces-around-statements We use if blocks without braces throughout
# -readability-braces-around-statements Ditto
# -hicpp-braces-around-statements Ditto
# -modernize-use-trailing-return-type We use the old style throughout
# -readability-implicit-bool-conversion Allow if(!ptr) rather than (ptr==nullptr)
......@@ -111,7 +111,7 @@ public:
class MANTID_API_DLL ProgressNotification : public AlgorithmNotification {
public:
/// Constructor
ProgressNotification(const Algorithm *const alg, double p, const std::string &msg, double estimatedTime,
ProgressNotification(const Algorithm *const alg, double p, std::string msg, double estimatedTime,
int progressPrecision);
std::string name() const override;
double progress; ///< Current progress. Value must be between 0 and 1.
......@@ -126,7 +126,7 @@ public:
class MANTID_API_DLL ErrorNotification : public AlgorithmNotification {
public:
/// Constructor
ErrorNotification(const Algorithm *const alg, const std::string &str);
ErrorNotification(const Algorithm *const alg, std::string str);
std::string name() const override;
std::string what; ///< message string
};
......
......@@ -23,7 +23,7 @@ class IAlgorithm;
*/
class MANTID_API_DLL AlgorithmHasProperty : public Kernel::TypedValidator<std::shared_ptr<IAlgorithm>> {
public:
AlgorithmHasProperty(const std::string &propName);
AlgorithmHasProperty(std::string propName);
std::string getType() const;
Kernel::IValidator_sptr clone() const override;
......
......@@ -51,7 +51,7 @@ public:
~AlgorithmHistory();
AlgorithmHistory &operator=(const AlgorithmHistory &);
AlgorithmHistory(const AlgorithmHistory &);
AlgorithmHistory(const std::string &name, int vers, std::string uuid,
AlgorithmHistory(std::string name, int vers, std::string uuid,
const Types::Core::DateAndTime &start = Types::Core::DateAndTime::getCurrentTime(),
const double &duration = -1.0, std::size_t uexeccount = 0);
void addExecutionInfo(const Types::Core::DateAndTime &start, const double &duration);
......
......@@ -21,7 +21,7 @@ namespace API {
*/
class MANTID_API_DLL CatalogSession {
public:
CatalogSession(const std::string &sessionID, const std::string &facility, const std::string &endpoint);
CatalogSession(std::string sessionID, std::string facility, std::string endpoint);
std::string getSessionId() const;
void setSessionId(const std::string &sessionID);
const std::string &getSoapEndpoint() const;
......
......@@ -18,7 +18,7 @@ namespace API {
*/
class MANTID_API_DLL FileBackedExperimentInfo : public ExperimentInfo {
public:
FileBackedExperimentInfo(const std::string &filename, const std::string &nxpath);
FileBackedExperimentInfo(std::string filename, std::string nxpath);
ExperimentInfo *cloneExperimentInfo() const override;
private:
......
......@@ -44,7 +44,7 @@ public:
class MANTID_API_DLL GroupingLoader {
public:
explicit GroupingLoader(Geometry::Instrument_const_sptr instrument);
GroupingLoader(Geometry::Instrument_const_sptr instrument, const std::string &mainFieldDirection);
GroupingLoader(Geometry::Instrument_const_sptr instrument, std::string mainFieldDirection);
virtual ~GroupingLoader();
/// Load the grouping from the instrument's IDF
std::shared_ptr<Grouping> getGroupingFromIDF() const;
......
......@@ -41,7 +41,7 @@ public:
/// Type of domain to create.
enum DomainType { Simple = 0, Sequential, Parallel };
/// Constrcutor
IDomainCreator(Kernel::IPropertyManager *manager, const std::vector<std::string> &workspacePropertyNames,
IDomainCreator(Kernel::IPropertyManager *manager, std::vector<std::string> workspacePropertyNames,
DomainType domainType = Simple);
/// Virtual destructor
virtual ~IDomainCreator() = default;
......
......@@ -23,7 +23,7 @@ namespace API {
*/
class MANTID_API_DLL LatticeDomain : public FunctionDomain {
public:
LatticeDomain(const std::vector<Kernel::V3D> &hkls);
LatticeDomain(std::vector<Kernel::V3D> hkls);
size_t size() const override;
......
......@@ -18,7 +18,7 @@ namespace Mantid {
namespace API {
class MANTID_API_DLL MDFrameValidator : public Kernel::TypedValidator<IMDWorkspace_sptr> {
public:
explicit MDFrameValidator(const std::string &frameName);
explicit MDFrameValidator(std::string frameName);
/// Gets the type of the validator
std::string getType() const { return "mdframe"; }
/// Clone the current state
......
......@@ -34,7 +34,7 @@ public:
/// Constructor
MultiPeriodGroupWorker() = default;
/// Constructor
MultiPeriodGroupWorker(const std::string &workspacePropertyName);
MultiPeriodGroupWorker(std::string workspacePropertyName);
virtual ~MultiPeriodGroupWorker() = default;
/// Flag to indicate use of a custom workspace property
bool useCustomWorkspaceProperty() const;
......
......@@ -29,7 +29,7 @@ class MatrixWorkspace;
class MANTID_API_DLL NumericAxis : public Axis {
public:
NumericAxis(const std::size_t &length);
NumericAxis(const std::vector<double> &centres);
NumericAxis(std::vector<double> centres);
Axis *clone(const MatrixWorkspace *const parentWorkspace) override;
Axis *clone(const std::size_t length, const MatrixWorkspace *const parentWorkspace) override;
......
......@@ -111,7 +111,7 @@ private:
/// Calculate the average gonoimeter matrix
void calculateAverageGoniometerMatrix();
/// Calculate the gonoimeter matrices from logs
void calculateGoniometerMatrices(Geometry::Goniometer goniometer);
void calculateGoniometerMatrices(const Geometry::Goniometer &goniometer);
/// Goniometer for this run
std::vector<std::unique_ptr<Geometry::Goniometer>> m_goniometers;
......
......@@ -80,7 +80,8 @@ public:
private:
/// Recursive function to load the algorithm history tree from file
void loadNestedHistory(::NeXus::File *file, AlgorithmHistory_sptr parent = std::shared_ptr<AlgorithmHistory>());
void loadNestedHistory(::NeXus::File *file,
const AlgorithmHistory_sptr &parent = std::shared_ptr<AlgorithmHistory>());
/// Parse an algorithm history string loaded from file
AlgorithmHistory_sptr parseAlgorithmHistory(const std::string &rawData);
/// Find the history entries at this level in the file.
......
......@@ -17,7 +17,7 @@ namespace API {
*/
class MANTID_API_DLL WorkspaceUnitValidator : public MatrixWorkspaceValidator {
public:
explicit WorkspaceUnitValidator(const std::string &unitID = "");
explicit WorkspaceUnitValidator(std::string unitID = "");
/// Gets the type of the validator
std::string getType() const { return "workspaceunit"; }
/// Clone the current state
......
......@@ -1879,15 +1879,15 @@ Algorithm::FinishedNotification::FinishedNotification(const Algorithm *const alg
: AlgorithmNotification(alg), success(res) {}
std::string Algorithm::FinishedNotification::name() const { return "FinishedNotification"; }
Algorithm::ProgressNotification::ProgressNotification(const Algorithm *const alg, double p, const std::string &msg,
Algorithm::ProgressNotification::ProgressNotification(const Algorithm *const alg, double p, std::string msg,
double estimatedTime, int progressPrecision)
: AlgorithmNotification(alg), progress(p), message(msg), estimatedTime(estimatedTime),
: AlgorithmNotification(alg), progress(p), message(std::move(msg)), estimatedTime(estimatedTime),
progressPrecision(progressPrecision) {}
std::string Algorithm::ProgressNotification::name() const { return "ProgressNotification"; }
Algorithm::ErrorNotification::ErrorNotification(const Algorithm *const alg, const std::string &str)
: AlgorithmNotification(alg), what(str) {}
Algorithm::ErrorNotification::ErrorNotification(const Algorithm *const alg, std::string str)
: AlgorithmNotification(alg), what(std::move(str)) {}
std::string Algorithm::ErrorNotification::name() const { return "ErrorNotification"; }
......
......@@ -8,12 +8,13 @@
#include "MantidAPI/IAlgorithm.h"
#include <memory>
#include <utility>
namespace Mantid {
namespace API {
/// Constructor
AlgorithmHasProperty::AlgorithmHasProperty(const std::string &propName) : m_propName(propName) {}
AlgorithmHasProperty::AlgorithmHasProperty(std::string propName) : m_propName(std::move(propName)) {}
/**
* Get a string representation of the type
......
......@@ -74,11 +74,10 @@ AlgorithmHistory::~AlgorithmHistory() = default;
(optional).
@param uexeccount :: an unsigned int for algorithm execution order
*/
AlgorithmHistory::AlgorithmHistory(const std::string &name, int vers, std::string uuid,
const Types::Core::DateAndTime &start, const double &duration,
std::size_t uexeccount)
: m_name(name), m_version(vers), m_executionDate(start), m_executionDuration(duration), m_execCount(uexeccount),
m_childHistories(), m_uuid(std::move(uuid)) {}
AlgorithmHistory::AlgorithmHistory(std::string name, int vers, std::string uuid, const Types::Core::DateAndTime &start,
const double &duration, std::size_t uexeccount)
: m_name(std::move(name)), m_version(vers), m_executionDate(start), m_executionDuration(duration),
m_execCount(uexeccount), m_childHistories(), m_uuid(std::move(uuid)) {}
/**
* Set the history properties for an algorithm pointer
......
......@@ -34,7 +34,7 @@ AlgorithmObserver::AlgorithmObserver(const IAlgorithm_const_sptr &alg)
m_finishObserver(*this, &AlgorithmObserver::_finishHandle),
m_errorObserver(*this, &AlgorithmObserver::_errorHandle),
m_startingObserver(*this, &AlgorithmObserver::_startingHandle) {
observeAll(std::move(alg));
observeAll(alg);
}
/// Virtual destructor
......
......@@ -111,7 +111,7 @@ void BoxControllerSettingsAlgorithm::setBoxController(const BoxController_sptr &
const Mantid::Geometry::Instrument_const_sptr &instrument) {
size_t nd = bc->getNDims();
takeDefaultsFromInstrument(std::move(instrument), nd);
takeDefaultsFromInstrument(instrument, nd);
setBoxController(bc);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment