All Projects → ec4j → editorconfig-gradle-plugin

ec4j / editorconfig-gradle-plugin

Licence: Apache-2.0, Unknown licenses found Licenses found Apache-2.0 LICENSE Unknown license-header-template.txt
A Gradle plugin for checking whether project files comply with format rules defined in .editorconfig files and eventually also for fixing the violations

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to editorconfig-gradle-plugin

Dexguard
Android app防dex2jar的gradle插件
Stars: ✭ 174 (+335%)
Mutual labels:  gradle-plugin
Gradle Swagger Generator Plugin
Gradle plugin for OpenAPI YAML validation, code generation and API document publishing
Stars: ✭ 197 (+392.5%)
Mutual labels:  gradle-plugin
Gradle Cargo Plugin
Gradle plugin that provides deployment capabilities to local and remote containers via Cargo
Stars: ✭ 238 (+495%)
Mutual labels:  gradle-plugin
Gradle Avro Plugin
A Gradle plugin to allow easily performing Java code generation for Apache Avro. It supports JSON schema declaration files, JSON protocol declaration files, and Avro IDL files.
Stars: ✭ 176 (+340%)
Mutual labels:  gradle-plugin
Jarfilterplugin
Help exclude classes before building the JAR into Android DEX archives.
Stars: ✭ 189 (+372.5%)
Mutual labels:  gradle-plugin
Javafx Gradle Plugin
Gradle plugin that makes it easy to work with JavaFX 11+
Stars: ✭ 214 (+435%)
Mutual labels:  gradle-plugin
Retropiler
PoC of Java8 Standard Library for Android for API version >= 15
Stars: ✭ 159 (+297.5%)
Mutual labels:  gradle-plugin
AndroidLintReporter
Gradle Plugin to report Android Lint and Detekt result back to Github Pull Request
Stars: ✭ 22 (-45%)
Mutual labels:  gradle-plugin
Gradle Baseline
A set of Gradle plugins that configure default code quality tools for developers.
Stars: ✭ 191 (+377.5%)
Mutual labels:  gradle-plugin
Gradle Android Git Version
A gradle plugin to calculate Android-friendly version names and codes from git tags
Stars: ✭ 227 (+467.5%)
Mutual labels:  gradle-plugin
Gradle Launch4j
A gradle-plugin to create windows executables with launch4j
Stars: ✭ 177 (+342.5%)
Mutual labels:  gradle-plugin
Gradle Testsets Plugin
A plugin for the Gradle build system that allows specifying test sets (like integration or acceptance tests).
Stars: ✭ 182 (+355%)
Mutual labels:  gradle-plugin
Badass Jlink Plugin
Create a custom runtime image of your modular application
Stars: ✭ 216 (+440%)
Mutual labels:  gradle-plugin
Click Debounce
Using ASM to handle Android's click debounce, specially a quick double click.
Stars: ✭ 175 (+337.5%)
Mutual labels:  gradle-plugin
Coveralls Gradle Plugin
👨‍🔧 gradle plugin for coveralls
Stars: ✭ 250 (+525%)
Mutual labels:  gradle-plugin
Vue Kotlin
Libraries and tools supporting the use of Vue.js in Kotlin.
Stars: ✭ 162 (+305%)
Mutual labels:  gradle-plugin
Gradle Errorprone Plugin
Gradle plugin to use the error-prone compiler for Java
Stars: ✭ 202 (+405%)
Mutual labels:  gradle-plugin
gradle-syntastic-plugin
A Gradle plugin for integrating your Java project with Vim and Syntastic.
Stars: ✭ 45 (+12.5%)
Mutual labels:  gradle-plugin
Avito Android
Infrastructure of Avito android
Stars: ✭ 253 (+532.5%)
Mutual labels:  gradle-plugin
Moko Widgets
Multiplatform UI DSL with screen management in common code for mobile (android & ios) Kotlin Multiplatform development
Stars: ✭ 227 (+467.5%)
Mutual labels:  gradle-plugin

editorconfig-gradle-plugin

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

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

⚠️
editorconfig-gradle-plugin is new. Expect issues of all kinds and you should definitely report 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 the editorconfigCheck to some other task existing in your project. E.g. if you have java plugin in your project, binding to check task is quite natural:

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

Configuration

There is editorconfig extension object. Its properties are documented in the EditorconfigExtension class.

editorconfig {

   # All files are included by default. Paths or patterns must be relative to the the project root directory.
   includes = ['src/**', 'build.gradle']

   # Exlude some files in addition to the default 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 sibling editorconfig-maven-plugin: org.ec4j.maven:ec4j-lint-api and org.ec4j.maven:ec4j-linters. They are 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 by default:
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+

The most common build with unit tests:

./gradlew clean build

On Windows:

.\gradlew.bat clean build

How to release

# Make sure you are no master
git status

relVersion=...
sed -i "s/version = '[^']'/version = '${relVersion}'/" build.gradle.kts
git add -A
git commit -m "Release ${relVersion}"
git tag ${relVersion}
./gradlew publishPlugins --no-daemon --stacktrace
git push upstream master
git push upstream ${relVersion}

Misc.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].