@@ -87,7 +87,13 @@ def proc_pipeline(name):
8787 Keyword arguments:
8888 name -- file name string
8989 """
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+
9197 if verbose1 or verbose2 :
9298 with print_lock :
9399 print ("Processing" , name )
@@ -129,7 +135,13 @@ def proc_standalone(name):
129135 Keyword arguments:
130136 name -- file name string
131137 """
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+
133145 if verbose2 :
134146 with print_lock :
135147 print ("Processing" , name )
@@ -179,7 +191,15 @@ def proc_batch(files):
179191 for subtask in task_pipeline :
180192 work = []
181193 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+
183203 if subtask .should_process_file (config_file , name ):
184204 work .append (name )
185205
@@ -477,7 +497,14 @@ def main():
477497 # Don't run tasks on modifiable or generated files
478498 work = []
479499 for name in files :
480- config_file = Config (os .path .dirname (name ), ".wpiformat" )
500+ try :
501+ config_file = Config (os .path .dirname (name ), ".wpiformat" )
502+ except OSError :
503+ # TODO: Remove handling for deprecated .styleguide file
504+ config_file = Config (os .path .dirname (name ), ".styleguide" )
505+ print (
506+ "Warning: found deprecated '.styleguide' file. Rename to '.wpiformat'."
507+ )
481508
482509 if config_file .is_modifiable_file (name ):
483510 continue
0 commit comments