File tree Expand file tree Collapse file tree 2 files changed +10
-13
lines changed
Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments