Closed tokee closed 6 years ago
I should install the Maven plugin that forces a single style (CheckStyle?!) and fix it in one big change.
Four Spaces FTW.
Hm, looks like CheckStyle can be used to validate but not fix. There are auto-formatters that use the Eclipse formatting engine e.g. but they are likely too aggressive.
I should be able to do the tabs-to-spaces conversion manually as a one-off.
Nasty, brutish but short:
find . -type f -name *.java -exec perl -pi -e 's,\t, ,g' {} \;
As far as I can infer, the code base is intended to be indented with tabs.
Running
find . -iname "*.java" -exec bash -c "echo -n {}\ tab-lines:\ ; grep -v ^[\ $'\t'][^*]*[*] < {} | grep -c ^$'\t' | tr -d '\n' ; echo -n "/" ; grep ^[\ $'\t'] < {} | grep -v ^[\ $'\t'][^*]*[*] | wc -l" \;
gives a list of all the files with tab-indented lines vs. all indented lines (that are not JavaDoc). Hacking a bit more, we get the statsShould we do something about this mess? And if we do, how do we avoid the mess in the future?