Update to clang-format-14
Required because the Jenkins CI tools have moved to v14.
Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
Change-Id: I3cf4df1b45325545a423bdcb810040724a598ec5
diff --git a/.clang-format b/.clang-format
index 7b4fbed..706a17c 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,28 +1,38 @@
---
+# Using clang-format-14
+# https://releases.llvm.org/14.0.0/tools/clang/docs/ClangFormatStyleOptions.html
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
-AlignConsecutiveAssignments: true
-AlignConsecutiveDeclarations: false
+AlignArrayOfStructures: None
+AlignConsecutiveAssignments: Consecutive
+AlignConsecutiveBitFields: Consecutive
+AlignConsecutiveDeclarations: None
+AlignConsecutiveMacros: None
AlignEscapedNewlines: Right
-AlignOperands: true
+AlignOperands: Align
AlignTrailingComments: true
+AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
-AllowShortBlocksOnASingleLine: false
+AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
+AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
-AllowShortIfStatementsOnASingleLine: false
+AllowShortIfStatementsOnASingleLine: Never
+AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
+AttributeMacros: []
BinPackArguments: true
BinPackParameters: true
+BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
- AfterControlStatement: true
+ AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
@@ -32,29 +42,36 @@
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
+ BeforeLambdaBody: false
+ BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
+BreakAfterJavaFieldAnnotations: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
+BreakBeforeConceptDeclarations: true
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
-BreakStringLiterals: true
+BreakStringLiterals: false
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
-ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
+DeriveLineEnding: false
DerivePointerAlignment: false
PointerAlignment: Left
DisableFormat: false
+EmptyLineAfterAccessModifier: Never
+EmptyLineBeforeAccessModifier: Always
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
+IfMacros: []
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^[<"](gtest|gmock)'
@@ -73,43 +90,101 @@
Priority: 5
- Regex: '.*'
Priority: 6
+IncludeIsMainRegex: ''
+IncludeIsMainSourceRegex: ''
+IndentAccessModifiers: false
+IndentCaseBlocks: false
IndentCaseLabels: true
+IndentExternBlock: NoIndent
+IndentGotoLabels: false
+IndentPPDirectives: None
+IndentRequires: false
IndentWidth: 4
IndentWrappedFunctionNames: true
-KeepEmptyLinesAtTheStartOfBlocks: true
+InsertTrailingCommas: None
+JavaImportGroups: []
+JavaScriptQuotes: Leave
+JavaScriptWrapImports: true
+KeepEmptyLinesAtTheStartOfBlocks: false
+LambdaBodyIndentation: Signature
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
+NamespaceMacros: []
+ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
+ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
+PPIndentWidth: -1
+PackConstructorInitializers: BinPack
+PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
+PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
+PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
+PenaltyIndentedWhitespace: 0
+QualifierAlignment: Leave
+# Only used when QualifierAlignment is 'Custom'
+# QualifierOrder: []
+RawStringFormats: []
+ReferenceAlignment: Pointer
ReflowComments: true
-SortIncludes: true
+RemoveBracesLLVM: false
+SeparateDefinitionBlocks: Leave
+ShortNamespaceLines: 1
+SortIncludes: CaseSensitive
+SortJavaStaticImport: Before
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
+SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
+SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
+SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
+SpaceBeforeParensOptions:
+ AfterControlStatements: true
+ AfterForeachMacros: true
+ AfterFunctionDefinitionName: false
+ AfterFunctionDeclarationName: false
+ AfterIfMacros: true
+ AfterOverloadedOperator: false
+ BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: true
+SpaceBeforeSquareBrackets: false
+SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
-SpacesInAngles: false
+SpacesInAngles: Never
+SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
+SpacesInLineCommentPrefix:
+ Minimum: 1
+ Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Latest
+StatementAttributeLikeMacros: []
+StatementMacros: []
TabWidth: 4
+TypenameMacros: []
+UseCRLF: false
UseTab: Never
+WhitespaceSensitiveMacros:
+ - STRINGIZE
+ - PP_STRINGIZE
+ - BOOST_PP_STRINGIZE
+ - NS_SWIFT_NAME
+ - CF_SWIFT_NAME
...
diff --git a/analyzer/create_pel.cpp b/analyzer/create_pel.cpp
index 03b2d1d..0988e4d 100644
--- a/analyzer/create_pel.cpp
+++ b/analyzer/create_pel.cpp
@@ -286,7 +286,6 @@
std::string __getMessageRegistry(AnalysisType i_type)
{
-
if (AnalysisType::SYSTEM_CHECKSTOP == i_type)
{
return "org.open_power.HwDiags.Error.Checkstop";
diff --git a/analyzer/plugins/p10-tod-plugins.cpp b/analyzer/plugins/p10-tod-plugins.cpp
index 8f1cc76..ad401d1 100644
--- a/analyzer/plugins/p10-tod-plugins.cpp
+++ b/analyzer/plugins/p10-tod-plugins.cpp
@@ -33,12 +33,12 @@
class Data
{
public:
- Data() = default;
- ~Data() = default;
- Data(const Data&) = default;
- Data(Data&&) = default;
+ Data() = default;
+ ~Data() = default;
+ Data(const Data&) = default;
+ Data(Data&&) = default;
Data& operator=(const Data&) = default;
- Data& operator=(Data&&) = default;
+ Data& operator=(Data&&) = default;
private:
/** The MDMT chips at fault (only one per topology). */
diff --git a/attn/attn_logging.cpp b/attn/attn_logging.cpp
index 20550a1..c31a656 100644
--- a/attn/attn_logging.cpp
+++ b/attn/attn_logging.cpp
@@ -423,7 +423,6 @@
void eventTerminate(std::map<std::string, std::string> i_additionalData,
char* i_tiInfoData)
{
-
uint32_t tiInfoSize = 0; // assume TI info was not available
if (nullptr != i_tiInfoData)
diff --git a/attn/attn_monitor.hpp b/attn/attn_monitor.hpp
index 7b70316..ac791cd 100644
--- a/attn/attn_monitor.hpp
+++ b/attn/attn_monitor.hpp
@@ -34,7 +34,6 @@
iv_gpioConfig(config), iv_gpioEventDescriptor(io),
iv_config(i_attnConfig)
{
-
requestGPIOEvent(); // registers the event handler
}
diff --git a/attn/pel/extended_user_header.hpp b/attn/pel/extended_user_header.hpp
index 3c782a8..fa4c7f6 100644
--- a/attn/pel/extended_user_header.hpp
+++ b/attn/pel/extended_user_header.hpp
@@ -43,12 +43,12 @@
class ExtendedUserHeader : public Section
{
public:
- ExtendedUserHeader() = delete;
- ~ExtendedUserHeader() = default;
- ExtendedUserHeader(const ExtendedUserHeader&) = default;
+ ExtendedUserHeader() = delete;
+ ~ExtendedUserHeader() = default;
+ ExtendedUserHeader(const ExtendedUserHeader&) = default;
ExtendedUserHeader& operator=(const ExtendedUserHeader&) = default;
ExtendedUserHeader(ExtendedUserHeader&&) = default;
- ExtendedUserHeader& operator=(ExtendedUserHeader&&) = default;
+ ExtendedUserHeader& operator=(ExtendedUserHeader&&) = default;
/**
* @brief Constructor
diff --git a/attn/pel/pel_minimal.hpp b/attn/pel/pel_minimal.hpp
index 780c666..9678518 100644
--- a/attn/pel/pel_minimal.hpp
+++ b/attn/pel/pel_minimal.hpp
@@ -37,12 +37,12 @@
class PelMinimal
{
public:
- PelMinimal() = delete;
- ~PelMinimal() = default;
- PelMinimal(const PelMinimal&) = delete;
+ PelMinimal() = delete;
+ ~PelMinimal() = default;
+ PelMinimal(const PelMinimal&) = delete;
PelMinimal& operator=(const PelMinimal&) = delete;
PelMinimal(PelMinimal&&) = delete;
- PelMinimal& operator=(PelMinimal&&) = delete;
+ PelMinimal& operator=(PelMinimal&&) = delete;
/**
* @brief Create a minimal PEL object from raw data
diff --git a/attn/pel/pel_section.hpp b/attn/pel/pel_section.hpp
index ca8dce4..6d18822 100644
--- a/attn/pel/pel_section.hpp
+++ b/attn/pel/pel_section.hpp
@@ -16,12 +16,12 @@
class Section
{
public:
- Section() = default;
- virtual ~Section() = default;
- Section(const Section&) = default;
+ Section() = default;
+ virtual ~Section() = default;
+ Section(const Section&) = default;
Section& operator=(const Section&) = default;
Section(Section&&) = default;
- Section& operator=(Section&&) = default;
+ Section& operator=(Section&&) = default;
/**
* @brief Returns a reference to the SectionHeader
diff --git a/attn/pel/primary_src.hpp b/attn/pel/primary_src.hpp
index be40448..d69e3a6 100644
--- a/attn/pel/primary_src.hpp
+++ b/attn/pel/primary_src.hpp
@@ -62,12 +62,12 @@
virtualProgressSRC = 0x80
};
- PrimarySrc() = delete;
- ~PrimarySrc() = default;
- PrimarySrc(const PrimarySrc&) = delete;
+ PrimarySrc() = delete;
+ ~PrimarySrc() = default;
+ PrimarySrc(const PrimarySrc&) = delete;
PrimarySrc& operator=(const PrimarySrc&) = delete;
PrimarySrc(PrimarySrc&&) = delete;
- PrimarySrc& operator=(PrimarySrc&&) = delete;
+ PrimarySrc& operator=(PrimarySrc&&) = delete;
/**
* @brief Constructor
diff --git a/attn/pel/private_header.hpp b/attn/pel/private_header.hpp
index d6739c7..011ade5 100644
--- a/attn/pel/private_header.hpp
+++ b/attn/pel/private_header.hpp
@@ -45,12 +45,12 @@
class PrivateHeader : public Section
{
public:
- PrivateHeader() = delete;
- ~PrivateHeader() = default;
- PrivateHeader(const PrivateHeader&) = default;
+ PrivateHeader() = delete;
+ ~PrivateHeader() = default;
+ PrivateHeader(const PrivateHeader&) = default;
PrivateHeader& operator=(const PrivateHeader&) = default;
PrivateHeader(PrivateHeader&&) = default;
- PrivateHeader& operator=(PrivateHeader&&) = default;
+ PrivateHeader& operator=(PrivateHeader&&) = default;
/**
* @brief Constructor
diff --git a/attn/pel/stream.hpp b/attn/pel/stream.hpp
index a82bd8a..5a1462d 100644
--- a/attn/pel/stream.hpp
+++ b/attn/pel/stream.hpp
@@ -49,12 +49,12 @@
class Stream
{
public:
- Stream() = delete;
- ~Stream() = default;
- Stream(const Stream&) = default;
+ Stream() = delete;
+ ~Stream() = default;
+ Stream(const Stream&) = default;
Stream& operator=(const Stream&) = default;
Stream(Stream&&) = default;
- Stream& operator=(Stream&&) = default;
+ Stream& operator=(Stream&&) = default;
/**
* @brief Constructor
diff --git a/attn/pel/user_header.hpp b/attn/pel/user_header.hpp
index 3be6e66..87cad50 100644
--- a/attn/pel/user_header.hpp
+++ b/attn/pel/user_header.hpp
@@ -33,12 +33,12 @@
class UserHeader : public Section
{
public:
- UserHeader() = delete;
- ~UserHeader() = default;
- UserHeader(const UserHeader&) = default;
+ UserHeader() = delete;
+ ~UserHeader() = default;
+ UserHeader(const UserHeader&) = default;
UserHeader& operator=(const UserHeader&) = default;
UserHeader(UserHeader&&) = default;
- UserHeader& operator=(UserHeader&&) = default;
+ UserHeader& operator=(UserHeader&&) = default;
/**
* @brief Constructor
diff --git a/test/test-cli.cpp b/test/test-cli.cpp
index 08595e4..f4c3a9a 100644
--- a/test/test-cli.cpp
+++ b/test/test-cli.cpp
@@ -6,7 +6,6 @@
TEST(TestCli, TestCliOptAll)
{
-
// Test --all on options
Config* config = new Config();
char* argv[2];
diff --git a/util/ffdc.cpp b/util/ffdc.cpp
index fd47d9a..e77012f 100644
--- a/util/ffdc.cpp
+++ b/util/ffdc.cpp
@@ -92,7 +92,6 @@
uint64_t usec{0};
if (0 == sd_journal_get_realtime_usec(journal, &usec))
{
-
// Convert realtime microseconds to date format
char dateBuffer[80];
std::string date;
diff --git a/util/ffdc_file.hpp b/util/ffdc_file.hpp
index 1658bb0..64b5186 100644
--- a/util/ffdc_file.hpp
+++ b/util/ffdc_file.hpp
@@ -37,12 +37,12 @@
{
public:
// Specify which compiler-generated methods we want
- FFDCFile() = delete;
- FFDCFile(const FFDCFile&) = delete;
- FFDCFile(FFDCFile&&) = default;
+ FFDCFile() = delete;
+ FFDCFile(const FFDCFile&) = delete;
+ FFDCFile(FFDCFile&&) = default;
FFDCFile& operator=(const FFDCFile&) = delete;
- FFDCFile& operator=(FFDCFile&&) = default;
- ~FFDCFile() = default;
+ FFDCFile& operator=(FFDCFile&&) = default;
+ ~FFDCFile() = default;
/**
* Constructor.
diff --git a/util/file_descriptor.hpp b/util/file_descriptor.hpp
index 425a2bb..0fc2690 100644
--- a/util/file_descriptor.hpp
+++ b/util/file_descriptor.hpp
@@ -19,8 +19,8 @@
class FileDescriptor
{
public:
- FileDescriptor() = default;
- FileDescriptor(const FileDescriptor&) = delete;
+ FileDescriptor() = default;
+ FileDescriptor(const FileDescriptor&) = delete;
FileDescriptor& operator=(const FileDescriptor&) = delete;
/**
diff --git a/util/temporary_file.hpp b/util/temporary_file.hpp
index 3065401..df0ab3c 100644
--- a/util/temporary_file.hpp
+++ b/util/temporary_file.hpp
@@ -26,7 +26,7 @@
{
public:
// Specify which compiler-generated methods we want
- TemporaryFile(const TemporaryFile&) = delete;
+ TemporaryFile(const TemporaryFile&) = delete;
TemporaryFile& operator=(const TemporaryFile&) = delete;
/**