• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ec4j/editorconfig-maven-plugin: A Maven plugin for checking whether project file ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

ec4j/editorconfig-maven-plugin

开源软件地址(OpenSource Url):

https://github.com/ec4j/editorconfig-maven-plugin

开源编程语言(OpenSource Language):

Java 97.9%

开源软件介绍(OpenSource Introduction):

editorconfig-maven-plugin

License Maven Central Travis CI build status AppVeyor Windows CI build status

editorconfig-maven-plugin is a Maven plugin for checking whether project files comply with format rules defined in .editorconfig files and eventually also for fixing the violations.

⚠️
editorconfig-maven-plugin is new. Expect issues of all kinds which is not to say that you should not report them :)

Basic usage

editorconfig-maven-plugin requires Java 8+ and Maven 3.3.1+.

To make the build fail if any of your source files does not comply with .editorconfig rules, add the following to your project:

  <plugin>
    <groupId>org.ec4j.maven</groupId>
    <artifactId>editorconfig-maven-plugin</artifactId>
    <version><!-- check the latest on http://central.maven.org/maven2/org/ec4j/maven/editorconfig-maven-plugin/ --></version>
    <executions>
      <execution>
        <id>check</id>
        <phase>verify</phase>
        <goals>
          <goal>check</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <!-- See http://ec4j.github.io/editorconfig-maven-plugin/ for full configuration reference -->
      <excludes>
        <!-- Note that maven submodule directories and many non-source file patterns are excluded by default -->
        <!-- see https://github.com/ec4j/editorconfig-linters/blob/master/editorconfig-lint-api/src/main/java/org/ec4j/lint/api/Constants.java#L37 -->
        <!-- You can exclude further files from processing: -->
        <exclude>src/main/**/*.whatever</exclude>
      </excludes>
      <!-- All files are included by default:
      <includes>
        <include>**</include>
      </includes>
      -->
    </configuration>
  </plugin>

In case any violations are detected, you may want to fix them automagically by running

mvn editorconfig:format

Configuration

How it works

editorconfig-maven-plugin is designed around the Linter interface. Linter is a processor specialized for some particular file format (such as YAML or XML) for which it can detect whether some particular .editorconfig properties are satisfied and eventually propose a fix that can be applied automatically.

Table 1. Linters available in editorconfig-maven-plugin
Class name Default includes Default excludes Supported .editorconfig properties

TextLinter

**/*

end_of_line, trim_trailing_whitespace, insert_final_newline

XmlLinter

**/*.xml, **/*.xsl

indent_style, indent_size

Contributions of further Linters are highly welcome! Please open an issue when you start working on something to avoid duplicate work.

How to build

Prerequisites:

  • Java 8+

  • Optionally Maven 3.5.0+, unless you want to use ./mvnw or mvnw.bat delivered by the project

The most common build with unit tests:

./mvnw clean install

On Windows:

.\mvnw.cmd clean install

Misc.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
apache/maven-pdf-plugin: Apache Maven PDF Plugin发布时间:2022-08-17
下一篇:
mdhasanai/BMI-CALCULATOR: BMI_CALCULATOR using javaFX (maven)发布时间:2022-08-17
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap