• Stars
    star
    680
  • Rank 63,732 (Top 2 %)
  • Language
    Groovy
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A pluggable and configurable linter tool for identifying and reporting on patterns of misuse or deprecations in Gradle scripts.

Gradle Lint Plugin

Support Status Gradle Plugin Portal Maven Central Build Apache 2.0

Purpose

The Gradle Lint plugin is a pluggable and configurable linter tool for identifying and reporting on patterns of misuse or deprecations in Gradle scripts and related files. It is inspired by the excellent ESLint tool for Javascript and by the formatting in NPM's eslint-friendly-formatter package.

It assists a centralized build tools team in gently introducing and maintaining a standard build script style across their organization.

Getting Started

Read the full documentation.

To apply this plugin, please get the latest version from the Gradle plugin portal and add the following to build.gradle:

buildscript { repositories { mavenCentral() } }
plugins {
  id 'nebula.lint' version '<latest version from the Gradle plugin portal>'
}

Important: For now, in a multi-module build you must apply lint to the root project, at a minimum.

Alternatively:

buildscript {
  repositories { mavenCentral() }
  dependencies {
    classpath 'com.netflix.nebula:gradle-lint-plugin:latest.release'
  }
}


apply plugin: 'nebula.lint'

Define which rules you would like to lint against:

gradleLint.rules = ['all-dependency'] // add as many rules here as you'd like

For an enterprise build, we recommend defining the lint rules in a init.gradle script or in a gradle script that is included via the Gradle apply from mechanism.

For multimodule projects, we recommend applying the plugin in an allprojects block:

allprojects {
  apply plugin: 'nebula.lint'
  gradleLint.rules = ['all-dependency'] // add as many rules here as you'd like
}

api/implementation support

v15.0.0 introduced api/implementation configuration support.

This allows to show warnings around api/implementation configurations

Since we need to do some major work to keep track of declared configurations and then replace code with the proper configuration, we decided to just show warnings for now.

This work includes finding dependency information for non resolvable configurations so we look into the parents

If gradle/gradle#11106 lands some day, we could definitely enhance this experience.

While it is great to have automatic fix, not having it is worse. So for now warning about this with the same detail as before is much better than a broken experience with new gradle configurations

Warning

Gradle Lint Plugin currently doesn't support:

  • kotlin build scripts. Please, switch to groovy build script if you want to use linting. #166

License

Copyright 2015-2018-2019 Netflix, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

gradle-ospackage-plugin

Gradle plugin for constructing linux packages, specifically RPM and DEBs.
Groovy
358
star
2

gradle-dependency-lock-plugin

A plugin to allow people using dynamic dependency versions to lock them to specific versions.
Groovy
286
star
3

nebula-release-plugin

Release opinions based around gradle-git
Groovy
211
star
4

gradle-extra-configurations-plugin

Gradle plugin introducing a provided dependency configuration and marking a dependency as optional.
Groovy
138
star
5

nebula-publishing-plugin

Publishing related plugins
Groovy
93
star
6

nebula-project-plugin

Healthy defaults for a standard Gradle project
Groovy
87
star
7

nebula-dependency-recommender-plugin

Leave off version numbers in your dependencies section and have versions recommended by several possible sources.
Groovy
69
star
8

gradle-metrics-plugin

Plugin to send Gradle metrics to external datasources
Java
66
star
9

nebula-kotlin-plugin

Provides the Kotlin plugin via the Gradle plugin portal, automatically depends on the standard library, and allows Kotlin library versions to be omitted
Groovy
57
star
10

gradle-info-plugin

Plugin to gather information about the environment
Groovy
47
star
11

nebula-test

Test harness for Gradle plugins
Groovy
43
star
12

gradle-resolution-rules-plugin

Gradle plugin for providing reusable dependency resolution rules.
Groovy
41
star
13

gradle-java-cross-compile-plugin

Automatic configuration of bootstrap classpath for Java, Groovy and Kotlin.
Kotlin
27
star
14

gradle-aggregate-javadocs-plugin

Provides the ability to aggregate Javadocs across all projects in a multi-project build.
Shell
25
star
15

nebula-docker-plugin

Plugin to help with assembling Docker images from Java apps in the context of using Nebula
Groovy
21
star
16

gradle-override-plugin

Override arbitrary properties in a Gradle build
Groovy
21
star
17

nebula-clojure-plugin

Plugin providing Clojuresque with compatibility fixes for Gradle 2.12 and later
Groovy
18
star
18

nebula-core

Classes common to other nebula plugins
Groovy
18
star
19

gradle-stash-plugin

Various tasks for interacting with the Stash SCM
Groovy
18
star
20

nebula-bintray-plugin

Bintray Tasks
Groovy
17
star
21

nebula-ospackage-plugin

Opinionated plugins that wrap the gradle-ospackage-plugin
Groovy
16
star
22

gradle-netflixoss-project-plugin

Gradle plugin to setup common needs for Netflix OSS projects
Groovy
16
star
23

nebula-plugin-plugin

Plugin for plugins, heavily opinionated about nebula-plugins
Groovy
15
star
24

gradle-jakartaee-migration-plugin

Provides Gradle capabilities and transforms to ease the migration from Java EE to Jakarta EE
Kotlin
15
star
25

gradle-git-scm-plugin

Git implementation of gradle-scm-plugin
Groovy
14
star
26

gradle-blacklist-plugin

Failing builds with bad dependencies. Replacing bundles, etc.
Groovy
14
star
27

gradle-contacts-plugin

Structure to define the owners of a project, then contributing this back to other plugins
Groovy
12
star
28

gradle-resolution-rules

Rules for the Resolution Rules plugin
Groovy
11
star
29

gradle-scm-plugin

Base SCM Plugin for gathering information or performing actions
Groovy
9
star
30

example-multiproject

An example multiproject demonstrating how we use the nebula plugins
Java
7
star
31

nebula-node-plugin

Groovy
6
star
32

ensure

Scripts to ensure Github is properly configured for this project
Groovy
5
star
33

nebula-interactive

JavaScript
5
star
34

gradle-rxjava-project-plugin

Gradle plugin to introduce conventions of a ReactiveX projects
Groovy
5
star
35

gradle-nothing-plugin

Literally does nothing. Used for testing gradle-plugin-plugin
Groovy
4
star
36

nebula-hollow-plugin

Java
4
star
37

lock-experimental

Experimental major overhaul of https://github.com/nebula-plugins/gradle-dependency-lock-plugin
Kotlin
4
star
38

nebula-plugins.github.io

JavaScript
3
star
39

example-project

An example project on how we use the nebula plugins on a simple project
Java
3
star
40

nebula-gradle-interop

Kotlin library providing extensions to assist with Gradle iterop and backwards compatibility
Groovy
2
star
41

lazybones-nebula-plugin-template

A lazybones template for creating new nebula plugins
Groovy
2
star
42

gradle-warnings-plugin

Allows for defining and emitting warnings.
Groovy
2
star
43

nebula-dependency-base-plugin

Kotlin
2
star
44

nebula-grails-plugin

Fork of the Grails 2.x Gradle plugin providing later Gradle version and plugin portal support.
Groovy
2
star
45

buildscan-test

Shell
1
star
46

nebula-oss-publishing-plugin

Publishes nebula projects to Netflix OSS repositories and Maven Central
Kotlin
1
star
47

nebula-blob-plugin

Copy files to S3 using Gradle FileSpec
Groovy
1
star