@@ -86,7 +86,13 @@ def proc_pipeline(name):
86
86
Keyword arguments:
87
87
name -- file name string
88
88
"""
89
- config_file = Config (os .path .dirname (name ), ".wpiformat" )
89
+ try :
90
+ config_file = Config (os .path .dirname (name ), ".wpiformat" )
91
+ except OSError :
92
+ # TODO: Remove handling for deprecated .styleguide file
93
+ config_file = Config (os .path .dirname (name ), ".styleguide" )
94
+ print ("Warning: found deprecated '.styleguide' file. Rename to '.wpiformat'." )
95
+
90
96
if verbose1 or verbose2 :
91
97
with print_lock :
92
98
print ("Processing" , name )
@@ -128,7 +134,13 @@ def proc_standalone(name):
128
134
Keyword arguments:
129
135
name -- file name string
130
136
"""
131
- config_file = Config (os .path .dirname (name ), ".wpiformat" )
137
+ try :
138
+ config_file = Config (os .path .dirname (name ), ".wpiformat" )
139
+ except OSError :
140
+ # TODO: Remove handling for deprecated .styleguide file
141
+ config_file = Config (os .path .dirname (name ), ".styleguide" )
142
+ print ("Warning: found deprecated '.styleguide' file. Rename to '.wpiformat'." )
143
+
132
144
if verbose2 :
133
145
with print_lock :
134
146
print ("Processing" , name )
@@ -178,7 +190,15 @@ def proc_batch(files):
178
190
for subtask in task_pipeline :
179
191
work = []
180
192
for name in files :
181
- config_file = Config (os .path .dirname (name ), ".wpiformat" )
193
+ try :
194
+ config_file = Config (os .path .dirname (name ), ".wpiformat" )
195
+ except OSError :
196
+ # TODO: Remove handling for deprecated .styleguide file
197
+ config_file = Config (os .path .dirname (name ), ".styleguide" )
198
+ print (
199
+ "Warning: found deprecated '.styleguide' file. Rename to '.wpiformat'."
200
+ )
201
+
182
202
if subtask .should_process_file (config_file , name ):
183
203
work .append (name )
184
204
@@ -443,7 +463,14 @@ def main():
443
463
# Don't run tasks on modifiable or generated files
444
464
work = []
445
465
for name in files :
446
- config_file = Config (os .path .dirname (name ), ".wpiformat" )
466
+ try :
467
+ config_file = Config (os .path .dirname (name ), ".wpiformat" )
468
+ except OSError :
469
+ # TODO: Remove handling for deprecated .styleguide file
470
+ config_file = Config (os .path .dirname (name ), ".styleguide" )
471
+ print (
472
+ "Warning: found deprecated '.styleguide' file. Rename to '.wpiformat'."
473
+ )
447
474
448
475
if config_file .is_modifiable_file (name ):
449
476
continue
0 commit comments