Skip to content

Commit 6adfdeb

Browse files
authored
Merge pull request #68 from OpenSimulationInterface/feature/travis-code-review
code analysis in Travis Ci (resolves #65)
2 parents e8549a1 + 33a4639 commit 6adfdeb

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,6 @@ script:
4343
- cmake -D CMAKE_PREFIX_PATH:PATH=${DEPS_DIR}/protobuf/install ..
4444
- cmake --build .
4545
- cd ..
46+
- python test_cases.py
4647
- python setup.py build
4748
- python setup.py sdist

doxygen_config.cmake.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ PROJECT_NUMBER = @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@
44

55
#Set input and output directories
66
INPUT = "@CMAKE_CURRENT_SOURCE_DIR@"
7-
INPUT += "@CMAKE_CURRENT_SOURCE_DIR@/README.md"
7+
INPUT += "@CMAKE_CURRENT_SOURCE_DIR@/README.md"
88

99
USE_MDFILE_AS_MAINPAGE = "@CMAKE_CURRENT_SOURCE_DIR@/README.md"
1010

1111
OUTPUT_DIRECTORY = "@CMAKE_CURRENT_SOURCE_DIR@/doc"
12-
IMAGE_PATH = "@CMAKE_CURRENT_SOURCE_DIR@/doc/images"
12+
IMAGE_PATH = "@CMAKE_CURRENT_SOURCE_DIR@/doc/images"
1313

1414
# There is no standard configuration for .proto files documentation.
1515
# A Doxygen filter for .proto files has to be added under the directory doc/.
1616
JAVADOC_AUTOBRIEF = NO
1717
EXTENSION_MAPPING = proto=C
1818
FILE_PATTERNS = *.proto
1919
INPUT_FILTER = "python @FILTER_PROTO2CPP_PY_PATH@/proto2cpp.py"
20-
HAVE_DOT = YES
21-
20+
HAVE_DOT = YES
21+

test_cases.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import sys
2+
from glob import *
3+
4+
state = 0
5+
6+
for file in glob("*.*"):
7+
if(file != "test_cases.py"):
8+
with open(file, "rt") as fin:
9+
i = 0
10+
for line in fin:
11+
i = i + 1
12+
13+
# Test case 1 is checking if there are illegal tabulators in the code
14+
if line.find("\t") != -1:
15+
print(file + " in line " + str(i) + ": not permitted tab found")
16+
state = 1
17+
18+
# Test case 2 is checking if there are more than the two allowed '/'
19+
if line.find("///") != -1:
20+
print(file + " in line " + str(i) + ": not permitted use of '///' ")
21+
state = 1
22+
23+
sys.exit(state)

0 commit comments

Comments
 (0)