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

Appearance settings

Provide explicit support for Groovy source code #13

Copy link
Copy link

Description

@sbrannen
Issue body actions

Status Quo

Groovy source code files are not officially supported by Spotless.

You therefore have to hack something together like the following:

format 'groovy', {
    target '**/*.groovy'
    indentWithTabs()
    trimTrailingWhitespace()
    endWithNewline()
    licenseHeaderFile rootProject.file('src/spotless/eclipse-public-license-1.0.java'), "package "

    customReplaceRegex 'class-level Javadoc indentation fix', /^\*/, ' *'
    customReplaceRegex 'nested Javadoc indentation fix', /\t\*/, '\t *'
}

Without the custom regular expressions, Spotless will mangle Javadoc and license header comment blocks.

Proposal

  • Support Groovy scripts as a first-class citizen with built-in support for license headers and Javadoc comment blocks.
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.