laurentgo commented on code in PR #41825: URL: https://github.com/apache/arrow/pull/41825#discussion_r1625485689
########## docs/source/developers/java/development.rst: ########## @@ -110,30 +110,58 @@ integration tests, you would do: Code Style ========== -Java code style is enforced with Checkstyle. The configuration is located at `checkstyle`_. -You can also just check the style without building the project. -This checks the code style of all source code under the current directory or from within an individual module. +The current Java code styles are configured as follows: -.. code-block:: +- Indent: Tabs & spaces (2 spaces per tab) +- Google Java Format: Reformats Java source code to comply with `Google Java Style`_. +- Configure license headers for Java & XML files - $ mvn checkstyle:check -Maven ``pom.xml`` style is enforced with Spotless using `Apache Maven pom.xml guidelines`_ -You can also just check the style without building the project. -This checks the style of all pom.xml files under the current directory or from within an individual module. +Java code style is checked by `Spotless`_ during the build, and the continuous integration build will verify +that changes adhere to the style guide. -.. code-block:: +Automatically fixing code style issues +-------------------------------------- + +- You can also just check the style without building the project with ``mvn spotless:check``. +- The Java code style can be corrected from the command line by using the following commands: ``mvn spotless:apply``. + +.. code-block:: bash - $ mvn spotless:check + The following files had format violations: + src/main/java/org/apache/arrow/algorithm/rank/VectorRank.java + @@ -15,7 +15,6 @@ + ·*·limitations·under·the·License. + ·*/ -This applies the style to all pom.xml files under the current directory or from within an individual module. + - + package·org.apache.arrow.algorithm.rank; + + import·java.util.stream.IntStream; + Run 'mvn spotless:apply' to fix these violations. + +Code Formatter for Intellij IDEA and Eclipse +-------------------------------------------- + +Follow the instructions for: + +- `Eclipse`_ +- `IntelliJ`_ + +Code style enforced with Checkstyle for most of the modules. The configuration is located at `checkstyle`_. +You can also just check the style without building the project. +This checks the code style of all source code under the current directory or from within an individual module. +Checkstyle will be removed once Spotless is fully integrated. Review Comment: I don't think this will be the case -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
