iotdb icon indicating copy to clipboard operation
iotdb copied to clipboard

code format: using the same code style

Open liukun4515 opened this issue 6 years ago • 5 comments

We use the different code style, which leads to a lot of diffs in prs. Unifying the code style is better. We can reference to google-java-format and checkstyle

liukun4515 avatar Sep 11 '18 09:09 liukun4515

We used different environments(Windows, OSX, Linux) during previous development. Now since everyone has an OSX environment, it will be convenient to unify our code style.

MyXOF avatar Sep 11 '18 09:09 MyXOF

We can add checkstyle plugin in pom.xml to check code style

liukun4515 avatar Sep 11 '18 13:09 liukun4515

I think a simple Reformat the code command before any commit will just do the trick. For non-IDE-users, figure out your own way.

jt2594838 avatar Sep 12 '18 08:09 jt2594838

Using the google-java-format plugin can help us to format code when compiling the code. You can use mvn compile to format your code, before submitting it. We can add checkstyle plugin to validate the code style and add checker in CI. @jt2594838

liukun4515 avatar Sep 12 '18 10:09 liukun4515

checkstyle +1

jixuan1989 avatar Oct 11 '18 15:10 jixuan1989