ukwa / webarchive-discovery

WARC and ARC indexing and discovery tools.
https://github.com/ukwa/webarchive-discovery/wiki
117 stars 25 forks source link

Clean up indentation in the code? #173

Closed tokee closed 6 years ago

tokee commented 6 years ago

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 stats

Should we do something about this mess? And if we do, how do we avoid the mess in the future?

anjackson commented 6 years ago

I should install the Maven plugin that forces a single style (CheckStyle?!) and fix it in one big change.

anjackson commented 6 years ago

Four Spaces FTW.

anjackson commented 6 years ago

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.

anjackson commented 6 years ago

Nasty, brutish but short:

find . -type f -name *.java -exec perl -pi -e 's,\t,    ,g' {} \;