- Notifications
You must be signed in to change notification settings - Fork13
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
ec4j/editorconfig-gradle-plugin
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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! |
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 havejava
plugin in your project, binding tocheck
task is quite natural:
// build.gradleplugins { id'java' id'org.ec4j.editorconfig' version'...'}check.dependsOn editorconfigCheck
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']}
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.
Class name | Default includes | Default excludes | Supported.editorconfig properties |
---|---|---|---|
| |||
|
Contributions of further Linters are highly welcome! Pleaseopen an issue when you start working on something to avoidduplicate work.
Prerequisites:
Java 8+
The most common build with unit tests:
./gradlew clean build
On Windows:
.\gradlew.bat clean build
# 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}
All code and contributions are underApache License
Issues and Discussions:https://github.com/ec4j/editorconfig-gradle-plugin/issues
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
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.