10
10
"geosoft" : "http://geosoft.no/development/geosoft_checks.xml" }
11
11
12
12
13
+ def check_invalid_configuration (checkstyle_configs , use_spaces , indent_size ):
14
+ if (checkstyle_configs is 'google' and
15
+ (not use_spaces or indent_size != 2 )):
16
+ raise ValueError ('Google checkstyle config does not support '
17
+ 'use_spaces=False or indent_size != 2' )
18
+
19
+
13
20
def known_checkstyle_or_path (setting ):
14
21
if str (setting ) in known_checkstyles .keys ():
15
22
return str (setting )
@@ -44,7 +51,8 @@ def setup_dependencies(self):
44
51
45
52
def create_arguments (
46
53
self , filename , file , config_file ,
47
- checkstyle_configs : known_checkstyle_or_path = "google" ):
54
+ checkstyle_configs : known_checkstyle_or_path = "google" ,
55
+ use_spaces : bool = True , indent_size : int = 2 ):
48
56
"""
49
57
:param checkstyle_configs:
50
58
A file containing configs to use in ``checkstyle``. It can also
@@ -64,6 +72,9 @@ def create_arguments(
64
72
- geosoft - The Java style followed by GeoSoft. More info at
65
73
<http://geosoft.no/development/javastyle.html>
66
74
"""
75
+ check_invalid_configuration (
76
+ checkstyle_configs , use_spaces , indent_size )
77
+
67
78
if checkstyle_configs in known_checkstyles :
68
79
checkstyle_configs = self .download_cached_file (
69
80
known_checkstyles [checkstyle_configs ],
0 commit comments