Just FYI here's spotless-maven-plugin
configuration (as specified in pom.xml
) and the Eclipse preferences file I ended up using - I am using Netbeans as my development platform. I still haven't figured out if everything works as it should though. Because it seems that e.g. spotless' own <indent>
configuration seems to need to be specified apart from eclipseWtp
, because the latter doesn't do tab-to-spaces substitution exactly the way I expect it to do it.
...
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.29.0</version>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
<configuration>
<formats>
<format>
<includes>
<include>**/*.html</include>
</includes>
<eclipseWtp>
<type>HTML</type>
<files>
<file>${project.basedir}/src/main/resources/org.eclipse.wst.html.core.prefs</file>
</files>
</eclipseWtp>
<trimTrailingWhitespace/>
<endWithNewline/>
<indent>
<spaces>true</spaces>
<spacesPerTab>4</spacesPerTab>
</indent>
</format>
</formats>
<java>
<toggleOffOn/>
<importOrder/>
<removeUnusedImports/>
<indent>
<spaces>true</spaces>
<spacesPerTab>4</spacesPerTab>
</indent>
<trimTrailingWhitespace />
<formatAnnotations/>
<palantirJavaFormat></palantirJavaFormat>
</java>
</configuration>
</plugin>
...
And here's contents of org.eclipse.wst.html.core.prefs
file I have placed into aforementioned ${project.basedir}/src/main/resources
folder (I did a rough search on the internet to find core and html specific content):
lineWidth=72
clearAllBlankLines=false
indentationChar=space
indentationSize=4
splitMultiAttrs=false
alignEndBracket=false
cleanupTagNameCase=0
cleanupAttrNameCase=0
insertRequiredAttrs=false
insertMissingTags=false
quoteAttrValues=true
formatSource=true
convertEOLCodes=false
inputCodeset=
outputCodeset=UTF-8
endOfLineCode=
tagNameCase=1
attrNameCase=1
defaultExtension=html
inlineElements=a,abbr,acronym,b,basefont,big,br,cite,em,font,i,img,input,label,li,q,s,select,small,span,strike,strong,sub,sup,td,th,title,u
attrDuplicate=2
attrInvalidName=2
attrInvalidValue=2
attrNameMismatch=2
attrNamesToIgnore=
attrUndefName=2
attrUndefValue=2
attrValueEqualsMissing=2
attrValueMismatch=1
attrValueUnclosed=2
cdataInvalidContent=2
cdataUnclosed=1
commentInvalidContent=2
commentUnclosed=1
docDoctypeUnclosed=1
docDuplicateTag=1
docInvalidChar=2
docInvalidContent=2
eclipse.preferences.version=1
elemCoexistence=2
elemDuplicate=2
elemEndInvalidCase=1
elemInvalidContent=2
elemInvalidDirective=1
elemInvalidEmptyTag=2
elemInvalidName=1
elemInvalidText=2
elemMissingEnd=2
elemMissingStart=2
elemStartInvalidCase=2
elemUnclosedEndTag=1
elemUnclosedStartTag=1
elemUnknownName=-1
elemUnnecessaryEnd=2
ignoreAttrNames=false
ignoreElementNames=false
piInvalidContent=2
piUnclosed=1
piUndefined=2
refInvalidContent=2
resourceNotFound=2