Skip to content

Commit f26b15e

Browse files
committed
astyle formatting
[ci skip]
1 parent 253f2c9 commit f26b15e

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

lib/importproject.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -342,24 +342,21 @@ void ImportProject::importCompileCommands(std::istream &istr)
342342
const std::string directory = dirpath;
343343

344344
std::ostringstream comm;
345-
if( obj.find( "arguments" ) != obj.end() ) {
346-
if( obj[ "arguments" ].is< picojson::array >() ) {
347-
for( const picojson::value& arg : obj[ "arguments" ].get< picojson::array >() ) {
348-
if( arg.is< std::string >() ) {
345+
if (obj.find("arguments") != obj.end()) {
346+
if (obj[ "arguments" ].is< picojson::array >()) {
347+
for (const picojson::value& arg : obj[ "arguments" ].get< picojson::array >()) {
348+
if (arg.is< std::string >()) {
349349
comm << arg.get< std::string >() << " ";
350350
}
351351
}
352-
}
353-
else {
352+
} else {
354353
return;
355354
}
356-
}
357-
else if( obj.find( "command" ) != obj.end() ) {
358-
if( obj[ "command" ].is< std::string >() ) {
355+
} else if (obj.find("command") != obj.end()) {
356+
if (obj[ "command" ].is< std::string >()) {
359357
comm << obj[ "command" ].get< std::string >();
360358
}
361-
}
362-
else {
359+
} else {
363360
return;
364361
}
365362

test/testimportproject.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ class TestImportProject : public TestFixture {
4747
TEST_CASE(importCompileCommands2); // #8563
4848
TEST_CASE(importCompileCommands3); // check with existing trailing / in directory
4949
TEST_CASE(importCompileCommands4); // only accept certain file types
50-
TEST_CASE(importCompileCommandsArgumentsSection); // Handle arguments section
51-
TEST_CASE(importCompileCommandsNoCommandSection); // gracefully handles malformed json
50+
TEST_CASE(importCompileCommandsArgumentsSection); // Handle arguments section
51+
TEST_CASE(importCompileCommandsNoCommandSection); // gracefully handles malformed json
5252
TEST_CASE(importCppcheckGuiProject);
5353
}
5454

0 commit comments

Comments
 (0)