@@ -87,7 +87,13 @@ def proc_pipeline(name):
87
87
Keyword arguments:
88
88
name -- file name string
89
89
"""
90
- config_file = Config (os .path .dirname (name ), ".wpiformat" )
90
+ try :
91
+ config_file = Config (os .path .dirname (name ), ".wpiformat" )
92
+ except OSError :
93
+ # TODO: Remove handling for deprecated .styleguide file
94
+ config_file = Config (os .path .dirname (name ), ".styleguide" )
95
+ print ("Warning: found deprecated '.styleguide' file. Rename to '.wpiformat'." )
96
+
91
97
if verbose1 or verbose2 :
92
98
with print_lock :
93
99
print ("Processing" , name )
@@ -129,7 +135,13 @@ def proc_standalone(name):
129
135
Keyword arguments:
130
136
name -- file name string
131
137
"""
132
- config_file = Config (os .path .dirname (name ), ".wpiformat" )
138
+ try :
139
+ config_file = Config (os .path .dirname (name ), ".wpiformat" )
140
+ except OSError :
141
+ # TODO: Remove handling for deprecated .styleguide file
142
+ config_file = Config (os .path .dirname (name ), ".styleguide" )
143
+ print ("Warning: found deprecated '.styleguide' file. Rename to '.wpiformat'." )
144
+
133
145
if verbose2 :
134
146
with print_lock :
135
147
print ("Processing" , name )
@@ -179,7 +191,15 @@ def proc_batch(files):
179
191
for subtask in task_pipeline :
180
192
work = []
181
193
for name in files :
182
- config_file = Config (os .path .dirname (name ), ".wpiformat" )
194
+ try :
195
+ config_file = Config (os .path .dirname (name ), ".wpiformat" )
196
+ except OSError :
197
+ # TODO: Remove handling for deprecated .styleguide file
198
+ config_file = Config (os .path .dirname (name ), ".styleguide" )
199
+ print (
200
+ "Warning: found deprecated '.styleguide' file. Rename to '.wpiformat'."
201
+ )
202
+
183
203
if subtask .should_process_file (config_file , name ):
184
204
work .append (name )
185
205
@@ -480,7 +500,14 @@ def main():
480
500
# Don't run tasks on modifiable or generated files
481
501
work = []
482
502
for name in files :
483
- config_file = Config (os .path .dirname (name ), ".wpiformat" )
503
+ try :
504
+ config_file = Config (os .path .dirname (name ), ".wpiformat" )
505
+ except OSError :
506
+ # TODO: Remove handling for deprecated .styleguide file
507
+ config_file = Config (os .path .dirname (name ), ".styleguide" )
508
+ print (
509
+ "Warning: found deprecated '.styleguide' file. Rename to '.wpiformat'."
510
+ )
484
511
485
512
if config_file .is_modifiable_file (name ):
486
513
continue
0 commit comments