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