Skip to content

Commit daaf7b6

Browse files
Add two test cases for Travis to check the code style
1 parent e8549a1 commit daaf7b6

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ script:
4545
- cd ..
4646
- python setup.py build
4747
- python setup.py sdist
48+
- python test_cases.py

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

0 commit comments

Comments
 (0)