Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
adjust formatter to include examples and use custom profile
Browse files Browse the repository at this point in the history
Custom format settings:
- EOL: LF
- don't adjust line wrapping when already wrapped
- use tabs and set indendation to 4
  • Loading branch information
lukaszstolarczuk committed Jun 30, 2020
1 parent 680d856 commit 9b07859
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.11.0</version>
<configuration>
<configFile>${project.build.sourceDirectory}/../resources/eclipse-formatter-config.xml</configFile>
<lineEnding>LF</lineEnding>
<directories>
<directory>${project.build.sourceDirectory}</directory>
<directory>${project.build.testSourceDirectory}</directory>
<directory>${project.build.sourceDirectory}/../../../examples</directory>
</directories>
</configuration>
<executions>
<execution>
<goals>
Expand Down
13 changes: 13 additions & 0 deletions src/main/resources/eclipse-formatter-config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="15">
<profile kind="CodeFormatterProfile" name="Custom Project Formatter" version="15">
<!-- this setting is needed for join_wrapped_lines to work, see:
https://github.com/revelc/formatter-maven-plugin/issues/289#issuecomment-475023352 -->
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="tab"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
</profile>
</profiles>

0 comments on commit 9b07859

Please sign in to comment.