Skip to content

Commit

Permalink
Resolve some trailing space issues for clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
wapcaplet committed May 31, 2020
1 parent 7b9ff20 commit b9e0bd5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2227,7 +2227,7 @@ void item::gun_info( const item *mod, std::vector<iteminfo> &info, const iteminf
info.emplace_back( tag, _( "Even chance of good hit at range: " ),
_( "<num>" ), iteminfo::no_flags, range );
int aim_mv = g->u.gun_engagement_moves( *mod, type.threshold );
info.emplace_back( tag, _( "Time to reach aim level: " ), _( "<num> moves " ),
info.emplace_back( tag, _( "Time to reach aim level: " ), _( "<num> moves" ),
iteminfo::lower_is_better, aim_mv );
}
}
Expand Down
19 changes: 10 additions & 9 deletions tests/iteminfo_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,11 +632,11 @@ TEST_CASE( "armor coverage, warmth, and encumbrance", "[iteminfo][armor][coverag
"--\n"
"<color_c_white>Covers</color>:"
" The <color_c_cyan>torso</color>."
" The <color_c_cyan>arms</color>. \n" ); // FIXME: Remove trailing space
" The <color_c_cyan>arms</color>. \n" ); // NOLINT(cata-text-style)

CHECK( item_info_str( longshirt, { iteminfo_parts::ARMOR_LAYER } ) ==
"--\n"
"Layer: <color_c_light_blue>Normal</color>. \n" );
"Layer: <color_c_light_blue>Normal</color>. \n" ); // NOLINT(cata-text-style)

// Coverage and warmth are displayed together on a single line
std::vector<iteminfo_parts> cov_warm = { iteminfo_parts::ARMOR_COVERAGE, iteminfo_parts::ARMOR_WARMTH };
Expand Down Expand Up @@ -1043,7 +1043,8 @@ TEST_CASE( "gun or other ranged weapon attributes", "[iteminfo][weapon][gun]" )
std::vector<iteminfo_parts> magazine = { iteminfo_parts::GUN_MAGAZINE };
std::vector<iteminfo_parts> aim_stats = { iteminfo_parts::GUN_AIMING_STATS };

// FIXME: Why empty?
// FIXME: This section is empty in-game for un-loaded glocks
// When loaded, empty "Type:" is replaced with "Magazine:" and "Ammunition:"
CHECK( item_info_str( glock, gun_type ) == "--\nType: \n" );
CHECK( item_info_str( glock, magazine ).empty() );

Expand All @@ -1052,13 +1053,13 @@ TEST_CASE( "gun or other ranged weapon attributes", "[iteminfo][weapon][gun]" )
"<color_c_white>Base aim speed</color>: <color_c_yellow>104</color>\n"
"<color_c_cyan>Regular</color>\n"
"Even chance of good hit at range: <color_c_yellow>3</color>\n"
"Time to reach aim level: <color_c_yellow>115</color> moves \n"
"Time to reach aim level: <color_c_yellow>115</color> moves\n"
"<color_c_cyan>Careful</color>\n"
"Even chance of good hit at range: <color_c_yellow>4</color>\n"
"Time to reach aim level: <color_c_yellow>145</color> moves \n"
"Time to reach aim level: <color_c_yellow>145</color> moves\n"
"<color_c_cyan>Precise</color>\n"
"Even chance of good hit at range: <color_c_yellow>6</color>\n"
"Time to reach aim level: <color_c_yellow>174</color> moves \n" );
"Time to reach aim level: <color_c_yellow>174</color> moves\n" );
}

SECTION( "compatible magazines" ) {
Expand Down Expand Up @@ -1807,12 +1808,12 @@ TEST_CASE( "bionic info", "[iteminfo][bionic]" )
// NOTE: Funky trailing space
CHECK( item_info_str( nostril, {} ) ==
"--\n"
"<color_c_white>Encumbrance</color>: \n"
"<color_c_white>Encumbrance</color>: \n" // NOLINT(cata-text-style)
"Mouth <color_c_yellow>10</color> " );

CHECK( item_info_str( purifier, {} ) ==
"--\n"
"<color_c_white>Environmental Protection</color>: \n"
"<color_c_white>Environmental Protection</color>: \n" // NOLINT(cata-text-style)
"Mouth <color_c_yellow>7</color> " );
}

Expand Down Expand Up @@ -2239,7 +2240,7 @@ TEST_CASE( "item debug info", "[iteminfo][debug][!mayfail][.]" )
"damage: <color_c_yellow>0</color>\n"
"active: <color_c_yellow>1</color>\n"
"burn: <color_c_yellow>0</color>\n"
"tags: \n"
"tags: \n" // NOLINT(cata-text-style)
"age (turns): <color_c_yellow>28800</color>\n"
"rot (turns): <color_c_yellow>0</color>\n"
" max rot (turns): <color_c_yellow>3888000</color>\n"
Expand Down

0 comments on commit b9e0bd5

Please sign in to comment.