| from __future__ import print_function |
| from scriptCommon import catchPath |
| def isSourceFile( path ): |
| return path.endswith( ".cpp" ) or path.endswith( ".h" ) or path.endswith( ".hpp" ) |
| def fixAllFilesInDir( dir ): |
| for f in os.listdir( dir ): |
| path = os.path.join( dir,f ) |
| if os.path.isfile( path ): |
| trimmed = line.rstrip() + "\n" |
| trimmed = trimmed.replace('\t', ' ') |
| changedFiles = changedFiles + 1 |
| print( " - fixed " + str(changed) + " line(s)" ) |
| altPath = path + ".backup" |
| os.rename( path, altPath ) |
| changedFiles = fixAllFilesInDir(catchPath) |
| print( "Fixed " + str(changedFiles) + " file(s)" ) |
| print( "No trailing whitespace found" ) |