I just realized after committing the CakePHP source to GitHub that they're now using tabs to indent code rather than four spaces. They also define this in the .editorconfig
file, which I've changed to this:
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
Is there a way to run through the entire source code and safely convert all tabs to four spaces for indentation? My reasoning is every developer on the repo uses four spaces and mixing and matching will cause the code to look out of place when looking at it on GitHub. And I'm just a fan of consistency :)
If I'm going down the home-brew way and writing my own script for this, I don't really mind what language although I'm more confident in PHP (not the best suited for the job, I know). Is this as simple as doing a preg_replace('~\t~', ' ', $fileText)
on each file?