Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
license-header-template.txt
NotificationsYou must be signed in to change notification settings

ec4j/editorconfig-gradle-plugin

Repository files navigation

https://github.com/ec4j/editorconfig-gradle-plugin/blob/master/LICENSEhttps://github.com/ec4j/editorconfig-gradle-plugin/actions

editorconfig-gradle-plugin is a Gradle plugin for checking whether project files comply with format rulesdefined in.editorconfig files and eventually also for fixing the violations.

⚠️
editorconfig-gradle-plugin is new. Expect issues of all kinds and you should definitelyreport them!

Basic usage

editorconfig-gradle-plugin requires Java 8+ and Gradle 4.1+.

To apply the plugin, add the following to your project:

plugins {...// Check the latest version at https://plugins.gradle.org/plugin/org.ec4j.editorconfig    id'org.ec4j.editorconfig' version'...'}

After that, you can check whether your source files comply with.editorconfig rules:

./gradlew editorconfigCheck

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

./gradlew editorconfigFormat

You also may want to bind theeditorconfigCheck to some other task existing in your project. E.g. if you havejavaplugin in your project, binding tocheck task is quite natural:

// build.gradleplugins {    id'java'    id'org.ec4j.editorconfig' version'...'}check.dependsOn editorconfigCheck

Configuration

There iseditorconfig extension object. Its properties are documented in theEditorconfigExtensionclass.

editorconfig {   #All files are included bydefault.Paths or patterns must be relative to the the project root directory.   includes= ['src/**','build.gradle']   #Exlude some filesin addition to thedefault excludes   #Paths or patterns must be relative to the the project root directory.   excludes= ['derby.log','LICENSE']}

How it works

editorconfig-gradle-plugin is using the same libraries as its siblingeditorconfig-maven-plugin:org.ec4j.maven:ec4j-lint-api andorg.ec4j.maven:ec4j-linters. They are designed around the Linter interface.Linteris a processor specialized for some particular file format (such as YAML or XML) for which it can detect whether someparticular.editorconfig properties are satisfied and eventually propose afix that canbe applied automatically.

Table 1. Linters available by default:
Class nameDefault includesDefault excludesSupported.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! Pleaseopen an issue when you start working on something to avoidduplicate work.

How to build

Prerequisites:

  • Java 8+

The most common build with unit tests:

./gradlew clean build

On Windows:

.\gradlew.bat clean build

How to release

# Make sure you are no mastergit statusrelVersion=...sed -i"s/version = '[^']'/version = '${relVersion}'/" build.gradle.ktsgit add -Agit commit -m"Release${relVersion}"git tag${relVersion}./gradlew publishPlugins --no-daemon --stacktracegit push upstream mastergit push upstream${relVersion}

Misc.

About

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

Topics

Resources

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
license-header-template.txt

Stars

Watchers

Forks

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp