在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):HubSpot/prettier-maven-plugin开源软件地址(OpenSource Url):https://github.com/HubSpot/prettier-maven-plugin开源编程语言(OpenSource Language):Java 99.9%开源软件介绍(OpenSource Introduction):prettier-maven-pluginMaven plugin for running prettier-java during a build. Node, prettier, and prettier-java are bundled into the plugin. There is a Example UsageThis example will run the <properties>
<!-- By default just re-write code with prettier -->
<plugin.prettier.goal>write</plugin.prettier.goal>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.hubspot.maven.plugins</groupId>
<artifactId>prettier-maven-plugin</artifactId>
<version>0.16</version>
<configuration>
<prettierJavaVersion>1.5.0</prettierJavaVersion>
<printWidth>90</printWidth>
<tabWidth>2</tabWidth>
<useTabs>false</useTabs>
<ignoreConfigFile>true</ignoreConfigFile>
<ignoreEditorConfig>true</ignoreEditorConfig>
<!-- Use <inputGlobs> to override the default input patterns -->
<inputGlobs>
<!-- These are the default patterns, you can omit <inputGlobs> entirely unless you want to override them -->
<inputGlob>src/main/java/**/*.java</inputGlob>
<inputGlob>src/test/java/**/*.java</inputGlob>
</inputGlobs>
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>${plugin.prettier.goal}</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>travis</id>
<activation>
<property>
<name>env.TRAVIS</name>
</property>
</activation>
<properties>
<!-- But in our CI environment we want to validate that code is formatted -->
<plugin.prettier.goal>check</plugin.prettier.goal>
</properties>
</profile>
</profiles> You can also run in a one-off fashion via the commandline: You can also run To format additional directories or file types via the commandline, you can pass a comma-separated list of patterns, for example: ConfigurationIf you want to customize the behavior of prettier, you can use a normal prettier configuration file. Alternatively, you can configure prettier directly via the Maven plugin using the following options:
NoteFor convenience, this plugin downloads Node, prettier, and prettier-java as needed. Node is downloaded from https://nodejs.org/dist/ and prettier-plugin-java is downloaded via npm |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论