Sunday, 1 July 2012

remove trailing whitespace before git commit

Hi,

Trailing whitespace always makes noises in version control system. We should remove trailing whitespace to avoid annoying other team members.

While working with remote developers we should follow some coding standarts and should form a habit to remove trailing whitespace before committing.


We can do it by git pre commit hook or deleting trailing whitespace by our own.

I hope all the IDE will support the code re-factoring. I am using rubymine and I used to refactotr code as below.

In rubymine

> On the main menu, choose Code | Reformat Code, or press Ctrl+Alt+L.

> In the Reformat Code dialogue box, specify the reformatting scope:
The current file.
Selected text.
All files in the current directory, including or omitting subdirectories.

> Click Run.


Thank You,
Uma Mahesh.

No comments:

Post a Comment