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

HTML files: remove trailing spaces. #12

Merged
merged 1 commit into from
Nov 10, 2020

Conversation

robertlipe
Copy link
Contributor

No description provided.

@YafeiJin
Copy link
Contributor

YafeiJin commented Nov 9, 2020

@robertlipe Thanks for your attentive check. Could you please share your method to clean? We would use it to check internally before the following release.

@robertlipe
Copy link
Contributor Author

Sure. My primary way is to configure sublime and vim to just strip them on every save. I didn't exactly want to do that to 1100 files, so I wrote a clumsy one-liner that turned into a two-liner:

find . ( -name build_out -o -name toolchain -o -name 3rdparty ) -prune -o
( -name '.c' -o -name '.h' -o -name '.mk' -o -name '.py' -o -name Makefile -o -name '.ld' )
-exec gsed -i -E 's/[[:space:]]
$//' {} ;
-exec gsed -i -E 's/\r\n/\n/' {} ;

find . ( -name build_out -o -name toolchain -o -name 3rdparty ) -prune -o
( -name '.c' -o -name '.h' )
-exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0" && chmod 0644 "$0";' {} ;

The version used in the HTML directory was different yet, but still recognizable from above.
find . ( -name build_out -o -name toolchain -o -name 3rdparty ) -prune -o
( -name '.html' -o -name '.txt' -o -name '.svg' -o -name '.py' -o -name Makefile )
-exec gsed -i -E 's/[[:space:]]*$//' {} ;
-exec gsed -i -E 's/\r\n/\n/' {} ;

If you want to get serious about them never slipping in again, use a git commit hook to look for and either reject or fix this on checkin so it doesn't happen again. Please do get internal developers to configure their editors to do this for them.

Thank you.

@YafeiJin
Copy link
Contributor

Thanks for your detailed description. We will follow your guide for the future release.

@YafeiJin YafeiJin merged commit 1ee9de9 into bouffalolab:master Nov 10, 2020
@robertlipe robertlipe deleted the clean_html branch November 10, 2020 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants