Skip to content

Commit 7e3626c

Browse files
committed
Travis: Check the naming conventions again
1 parent 8198bd5 commit 7e3626c

4 files changed

Lines changed: 21 additions & 12 deletions

File tree

.travis.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,14 @@ script:
220220
- make -s -j2
221221
# building gui generates some more files that cppcheck can check, so check the repo *after* building gui
222222
- cd ../
223-
# self check
224-
- ${CPPCHECK} --template=gcc -D__CPPCHECK__ --error-exitcode=1 --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml/ -Icli --inconclusive --enable=style,performance,portability,warning,internal --exception-handling --inline-suppr --suppressions-list=.travis_suppressions -itest/cli -itest/synthetic -itest/testsuites -iaddons -igui cli lib gui test tools -j 2
223+
# self check lib/cli
224+
- mkdir b1
225+
- ${CPPCHECK} -j2 --template=gcc --cppcheck-build-dir=b1 -D__CPPCHECK__ --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=cppcheck-lib --addon=naming.json -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml/ -Icli --inconclusive --enable=style,performance,portability,warning,internal --exception-handling cli lib
225226
# check gui with qt settings
226-
- ${CPPCHECK} --template=gcc -D__CPPCHECK__ -DQT_VERSION=0x050000 --library=qt --error-exitcode=1 -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml/ -Icli --enable=style,performance,portability,warning,internal --exception-handling -j 2 gui/*.cpp --suppressions-list=.travis_suppressions -igui/test
227-
# check naming conventions TODO this is temporarily disabled
228-
# - ${CPPCHECK} -i gui/test -j 2 --dump -q gui lib
229-
# - find lib gui -maxdepth 1 -name "*.dump" | xargs -n 1 -P 4 python addons/naming.py --private-member-variable='m[A-Z].*'
227+
- mkdir b2
228+
- ${CPPCHECK} -j2 --template=gcc --cppcheck-build-dir=b2 -D__CPPCHECK__ -DQT_VERSION=0x050000 --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=qt --addon=naming.json -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml/ --enable=style,performance,portability,warning,internal --exception-handling gui/*.cpp
229+
# self check test and tools
230+
- ${CPPCHECK} -j2 --template=gcc -D__CPPCHECK__ --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml/ -Icli --inconclusive --enable=style,performance,portability,warning,internal --exception-handling test/*.cpp tools
230231
# Build gui
231232
- cd ./gui
232233
# clean rebuild

cli/cppcheckexecutor.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
/*static*/ FILE* CppCheckExecutor::mExceptionOutput = stdout;
8080

8181
CppCheckExecutor::CppCheckExecutor()
82-
: mSettings(nullptr), latestProgressOutputTime(0), mErrorOutput(nullptr), mShowAllErrors(false)
82+
: mSettings(nullptr), mLatestProgressOutputTime(0), mErrorOutput(nullptr), mShowAllErrors(false)
8383
{
8484
}
8585

@@ -848,7 +848,7 @@ int CppCheckExecutor::check_internal(CppCheck& cppcheck, int /*argc*/, const cha
848848
}
849849

850850
if (settings.reportProgress)
851-
latestProgressOutputTime = std::time(nullptr);
851+
mLatestProgressOutputTime = std::time(nullptr);
852852

853853
if (!settings.outputFile.empty()) {
854854
mErrorOutput = new std::ofstream(settings.outputFile);
@@ -1016,13 +1016,13 @@ void CppCheckExecutor::reportProgress(const std::string &filename, const char st
10161016
{
10171017
(void)filename;
10181018

1019-
if (!latestProgressOutputTime)
1019+
if (!mLatestProgressOutputTime)
10201020
return;
10211021

10221022
// Report progress messages every 10 seconds
10231023
const std::time_t currentTime = std::time(nullptr);
1024-
if (currentTime >= (latestProgressOutputTime + 10)) {
1025-
latestProgressOutputTime = currentTime;
1024+
if (currentTime >= (mLatestProgressOutputTime + 10)) {
1025+
mLatestProgressOutputTime = currentTime;
10261026

10271027
// format a progress message
10281028
std::ostringstream ostr;

cli/cppcheckexecutor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class CppCheckExecutor : public ErrorLogger {
175175
/**
176176
* Report progress time
177177
*/
178-
std::time_t latestProgressOutputTime;
178+
std::time_t mLatestProgressOutputTime;
179179

180180
/**
181181
* Output file name for exception handler

naming.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"script": "addons/naming.py",
3+
"args": [
4+
"--private-member-variable=m[A-Z].*"
5+
"--var=[a-z].*",
6+
"--function=[a-z].*"
7+
]
8+
}

0 commit comments

Comments
 (0)