Coder Social home page Coder Social logo

olevett / editorconfig-maven-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ec4j/editorconfig-maven-plugin

0.0 2.0 0.0 810 KB

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

License: Apache License 2.0

Java 97.77% CSS 2.23%

editorconfig-maven-plugin's 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 7+ 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-maven-plugin/blob/master/ec4j-lint-api/src/main/java/org/ec4j/maven/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 7+

  • 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.

editorconfig-maven-plugin's People

Contributors

ppalaga avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.