From fd9af82a86bc184dc659cd193bd1f8a148cb51fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Mon, 22 Jan 2024 11:54:15 +0100 Subject: [PATCH] removed deprecated `--showtime=` value `top5` (#5904) --- cli/cmdlineparser.cpp | 8 +------- man/cppcheck.1.xml | 2 +- releasenotes.txt | 1 + test/testcmdlineparser.cpp | 7 +++---- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index f15f37b8b62..a89501f21ed 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -1098,10 +1098,6 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a mSettings.showtime = SHOWTIME_MODES::SHOWTIME_FILE_TOTAL; else if (showtimeMode == "summary") mSettings.showtime = SHOWTIME_MODES::SHOWTIME_SUMMARY; - else if (showtimeMode == "top5") { - mSettings.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE; - mLogger.printMessage("--showtime=top5 is deprecated and will be removed in Cppcheck 2.14. Please use --showtime=top5_file or --showtime=top5_summary instead."); - } else if (showtimeMode == "top5_file") mSettings.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE; else if (showtimeMode == "top5_summary") @@ -1113,7 +1109,7 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a return Result::Fail; } else { - mLogger.printError("unrecognized --showtime mode: '" + showtimeMode + "'. Supported modes: file, file-total, summary, top5, top5_file, top5_summary."); + mLogger.printError("unrecognized --showtime mode: '" + showtimeMode + "'. Supported modes: file, file-total, summary, top5_file, top5_summary."); return Result::Fail; } } @@ -1582,8 +1578,6 @@ void CmdLineParser::printHelp() const " Show the top 5 for each processed file\n" " * top5_summary\n" " Show the top 5 summary at the end\n" - " * top5\n" - " Alias for top5_file (deprecated)\n" " --std= Set standard.\n" " The available options are:\n" " * c89\n" diff --git a/man/cppcheck.1.xml b/man/cppcheck.1.xml index f6838587b62..d75cd498065 100644 --- a/man/cppcheck.1.xml +++ b/man/cppcheck.1.xml @@ -574,7 +574,7 @@ There are false positives with this option. Each result must be carefully invest Show timing information. The available mode are: - noneShow nothing (default)fileShow for each processed filefile-totalShow total time only for each processed filesummaryShow a summary at the endtop5_fileShow the top 5 for each processed filetop5_summaryShow the top 5 summary at the endtop5Alias for top5_file (deprecated) + noneShow nothing (default)fileShow for each processed filefile-totalShow total time only for each processed filesummaryShow a summary at the endtop5_fileShow the top 5 for each processed filetop5_summaryShow the top 5 summary at the end diff --git a/releasenotes.txt b/releasenotes.txt index 6b313cce25d..1679d80e224 100644 --- a/releasenotes.txt +++ b/releasenotes.txt @@ -22,3 +22,4 @@ Other: - Using Visual Studio with CMake now checks if the CMake version is at least 3.13. This was always required but was not checked explicitly. - Added '--template=simple'. It is expands to '{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]' without any additional location details. - Removed deprecated platform type 'Unspecified'. Please use 'unspecified' instead. +- Removed deprecated '--showtime=' value 'top5'. Please use 'top5_file' or 'top5_summary' instead. \ No newline at end of file diff --git a/test/testcmdlineparser.cpp b/test/testcmdlineparser.cpp index 07d179b2b33..a9886cd1304 100644 --- a/test/testcmdlineparser.cpp +++ b/test/testcmdlineparser.cpp @@ -1743,9 +1743,8 @@ class TestCmdlineParser : public TestFixture { REDIRECT; const char * const argv[] = {"cppcheck", "--showtime=top5", "file.cpp"}; settings->showtime = SHOWTIME_MODES::SHOWTIME_NONE; - ASSERT_EQUALS(CmdLineParser::Result::Success, parser->parseFromArgs(3, argv)); - ASSERT(settings->showtime == SHOWTIME_MODES::SHOWTIME_TOP5_FILE); - ASSERT_EQUALS("cppcheck: --showtime=top5 is deprecated and will be removed in Cppcheck 2.14. Please use --showtime=top5_file or --showtime=top5_summary instead.\n", logger->str()); + ASSERT_EQUALS(CmdLineParser::Result::Fail, parser->parseFromArgs(3, argv)); + ASSERT_EQUALS("cppcheck: error: unrecognized --showtime mode: 'top5'. Supported modes: file, file-total, summary, top5_file, top5_summary.\n", logger->str()); } void showtimeTop5File() { @@ -1783,7 +1782,7 @@ class TestCmdlineParser : public TestFixture { REDIRECT; const char * const argv[] = {"cppcheck", "--showtime=top10", "file.cpp"}; ASSERT_EQUALS(CmdLineParser::Result::Fail, parser->parseFromArgs(3, argv)); - ASSERT_EQUALS("cppcheck: error: unrecognized --showtime mode: 'top10'. Supported modes: file, file-total, summary, top5, top5_file, top5_summary.\n", logger->str()); + ASSERT_EQUALS("cppcheck: error: unrecognized --showtime mode: 'top10'. Supported modes: file, file-total, summary, top5_file, top5_summary.\n", logger->str()); } void errorlist() {