Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed trailing spaces #579

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open

removed trailing spaces #579

wants to merge 1 commit into from

Conversation

tdev
Copy link

@tdev tdev commented Mar 14, 2014

Removed trailing spaces from:

  • *.cpp, *.h, *.c, *.hlsl, *.glsl, *.gui in the folder Engine/source and below
  • *.cs, *.gui in the root folder and below

…rce and from .cs, .gui in the whole folder
@dottools
Copy link

Doesn't seem worth it unless it also fixes the code style problems and corrects code alignment for 4 spaces instead of 3.

@tdev
Copy link
Author

tdev commented Mar 14, 2014

Doesn't seem worth it unless it also fixes the code style problems and corrects code alignment for 4 spaces instead of 3.

that should happen as step 2 ;)

@crabmusket
Copy link
Contributor

I see no reason not to do this in our 'future' branch. Do you have any idea why the automatic merge fails?

@tdev
Copy link
Author

tdev commented Mar 15, 2014

I see no reason not to do this in our 'future' branch.
i see no reason why we should delay it?

Do you have any idea why the automatic merge fails?
I think some applied patch broke it.

anyways, this is the script that does the job:

import os
import operator

def fixTrailingSpaces(path, sexts):
    exts = {}
    for path, dirs, files in os.walk('.'):
        for f in files:
            file_name, file_extension = os.path.splitext(f)
            if not file_extension in exts:
                exts[file_extension] = 0
            exts[file_extension] += 1
            #continue

            if file_extension in sexts:
                path_name = os.path.join(path, f)
                print path_name
                with open(path_name, 'r') as fh:
                    new = [line.rstrip() for line in fh]
                with open(path_name, 'w') as fh:
                    [fh.write('%s\n' % line) for line in new]

    for e in sorted(exts.iteritems(), key=operator.itemgetter(1), reverse=True):
        print "% 5d : %s" %(e[1], e[0])

fixTrailingSpaces('.', ".cs .gui".split())
fixTrailingSpaces('Engine/source', ".c .cpp .h .hlsl .glsl".split())

@crabmusket
Copy link
Contributor

Uh sorry, by 'future' branch I mean whatever branch we end up using for sweeping changes that may upset people :P. But yeah, this seems pretty inoffensive.

@tdev
Copy link
Author

tdev commented Mar 15, 2014

alright, i vote for leaving this open to the end, so we won't forget ;)

@tdev tdev self-assigned this Mar 16, 2014
@crabmusket crabmusket added this to the 4.0 milestone Mar 28, 2014
@John3 John3 mentioned this pull request Jul 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants