From 3cbfecb24245ea6d0bdc7c0591728066ab1c9aad Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Fri, 1 Sep 2023 13:57:50 -0500 Subject: [PATCH] code format --- FWCore/Framework/bin/cmsRun.cpp | 10 ++++------ FWCore/Integration/test/ProcessAccelerator_t.cpp | 6 ++++-- FWCore/PythonParameterSet/src/PyBind11ProcessDesc.cc | 9 ++++----- .../PythonParameterSet/test/makeprocess_t.cppunit.cc | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/FWCore/Framework/bin/cmsRun.cpp b/FWCore/Framework/bin/cmsRun.cpp index 7a9c2beed6367..860f602870299 100644 --- a/FWCore/Framework/bin/cmsRun.cpp +++ b/FWCore/Framework/bin/cmsRun.cpp @@ -116,13 +116,12 @@ namespace { std::vector result; std::string configName; if (!args.empty() and !args[0].empty()) { - if(args[0][0]!='-'){ // name is first positional arg -> doesn't start with '-' + if (args[0][0] != '-') { // name is first positional arg -> doesn't start with '-' configName = args[0]; args.erase(args.begin()); - } - else if(args[0]=="--" and args.size()>1){ // name can start with '-' if separator comes first + } else if (args[0] == "--" and args.size() > 1) { // name can start with '-' if separator comes first configName = args[1]; - args.erase(args.begin(),args.begin()+2); + args.erase(args.begin(), args.begin() + 2); } } if (!configName.empty()) { @@ -260,8 +259,7 @@ int main(int argc, char* argv[]) { << "For usage and an options list, please do 'cmsRun --help'."; edm::HaltMessageLogging(); return edm::errors::ConfigFileNotFound; - } - else + } else fileName = vm[kParameterSetOpt].as(); std::vector pythonOptValues; if (vm.count(kPythonOpt)) { diff --git a/FWCore/Integration/test/ProcessAccelerator_t.cpp b/FWCore/Integration/test/ProcessAccelerator_t.cpp index 37b75ca82834c..7dd31841cac9a 100644 --- a/FWCore/Integration/test/ProcessAccelerator_t.cpp +++ b/FWCore/Integration/test/ProcessAccelerator_t.cpp @@ -227,7 +227,8 @@ TEST_CASE("Configuration with ModuleTypeResolver", s_tag) { SECTION("Configuration hash is not changed") { std::unique_ptr pset_auto, pset_cpu, pset_other, pset_cpuExplicit; - std::unique_ptr pset_otherExplicit, psetOtherDisabled_auto, psetOtherDisabled_cpu, psetOtherDisabled_other; + std::unique_ptr pset_otherExplicit, psetOtherDisabled_auto, psetOtherDisabled_cpu, + psetOtherDisabled_other; edm::makeParameterSets(baseConfig_auto, pset_auto); edm::makeParameterSets(baseConfig_cpu, pset_cpu); edm::makeParameterSets(baseConfig_other, pset_other); @@ -235,7 +236,8 @@ TEST_CASE("Configuration with ModuleTypeResolver", s_tag) { edm::makeParameterSets(baseConfig_otherExplicit, pset_otherExplicit); edm::makeParameterSets(baseConfigOtherDisabled_auto, psetOtherDisabled_auto); edm::makeParameterSets(baseConfigOtherDisabled_cpu, psetOtherDisabled_cpu); - REQUIRE_THROWS_WITH(edm::makeParameterSets(baseConfigOtherDisabled_other, psetOtherDisabled_other), Catch::Contains("UnavailableAccelerator")); + REQUIRE_THROWS_WITH(edm::makeParameterSets(baseConfigOtherDisabled_other, psetOtherDisabled_other), + Catch::Contains("UnavailableAccelerator")); pset_auto->registerIt(); pset_cpu->registerIt(); pset_other->registerIt(); diff --git a/FWCore/PythonParameterSet/src/PyBind11ProcessDesc.cc b/FWCore/PythonParameterSet/src/PyBind11ProcessDesc.cc index d4eb14c89cc97..af4f9784c746c 100644 --- a/FWCore/PythonParameterSet/src/PyBind11ProcessDesc.cc +++ b/FWCore/PythonParameterSet/src/PyBind11ProcessDesc.cc @@ -25,16 +25,15 @@ PyBind11InterpreterSentry::~PyBind11InterpreterSentry() { PyBind11ProcessDesc::PyBind11ProcessDesc() : theProcessPSet(), theInterpreter(false) {} -PyBind11ProcessDesc::PyBind11ProcessDesc(std::string const& config, bool isFile) : theProcessPSet(), theInterpreter(true) { +PyBind11ProcessDesc::PyBind11ProcessDesc(std::string const& config, bool isFile) + : theProcessPSet(), theInterpreter(true) { edm::python::initializePyBind11Module(); prepareToRead(); read(config, isFile); } PyBind11ProcessDesc::PyBind11ProcessDesc(std::string const& config, bool isFile, const std::vector& args) - : theProcessPSet(), - theInterpreter(true) -{ + : theProcessPSet(), theInterpreter(true) { edm::python::initializePyBind11Module(); prepareToRead(); { @@ -69,7 +68,7 @@ void PyBind11ProcessDesc::read(std::string const& config, bool isFile) { if (isFile) readFile(config); else - readString(config); + readString(config); } catch (pybind11::error_already_set const& e) { edm::pythonToCppException("Configuration", e.what()); } diff --git a/FWCore/PythonParameterSet/test/makeprocess_t.cppunit.cc b/FWCore/PythonParameterSet/test/makeprocess_t.cppunit.cc index b479715404ca4..780278f6db145 100644 --- a/FWCore/PythonParameterSet/test/makeprocess_t.cppunit.cc +++ b/FWCore/PythonParameterSet/test/makeprocess_t.cppunit.cc @@ -54,7 +54,7 @@ class testmakeprocess : public CppUnit::TestFixture { typedef std::shared_ptr ParameterSetPtr; ParameterSetPtr pSet(char const* c) { //ParameterSetPtr result( new edm::ProcessDesc(std::string(c)) ); - ParameterSetPtr result = PyBind11ProcessDesc(std::string(c),false).parameterSet(); + ParameterSetPtr result = PyBind11ProcessDesc(std::string(c), false).parameterSet(); CPPUNIT_ASSERT(result->getParameter("@process_name") == "test"); return result; }