jsch
jsch copied to clipboard
Add checkstyle to maven build and fix whitespace after for/while
JSch is a mature project. As every mature project, it has legacy code with inconsistent formatting. It makes hard to read/modify/audit the source code.
I propose to improve formatting step by step in separate PRs/commits.
In this PR I have added missing spaces after cycles: for/while.
To make sure code style will not regress over time I propose to add maven-checkstyle-plugin
to build process. Checkstyle has a lot of useful checks which can used to verify the code. I have plan to enable some them in separate PRs.
What do you think?
I have to say that I oppose such a massive change like this. It would cause severe disruption for several ongoing changes I'm working on, and would also make merging changes from other JSch forks far more difficult.
@turbanoff thanks for your PR. Indeed, clear formatting would help to improve the readability of the code. I will keep it open until we have finished other things, which might bring more value to the project at the moment. If you look at #11 there are lots of bugs reported from static code analysis, but fixing them might also cause merging problems. Once we decide to decouple from forks and upstream, everything should be open to change those things.
What do we think of instead perhaps moving to the Google Java Style for everything?
We could just do a single massive reformat of everything once I'm finished with some other outstanding changes.
Closing as we added formatting in #247