Provide explicit support for Groovy source code
See original GitHub issueStatus 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.
Issue Analytics
- State:
- Created 8 years ago
- Comments:22 (21 by maintainers)
Top Results From Across the Web
Groovy Language Documentation
provides the ability to statically type check and statically compile your code for robustness and performance. supports Domain-Specific Languages and other ...
Read more >Style guide - The Apache Groovy programming language
Groovy provides native syntax constructs for data structures like lists, maps, regex, or ranges of values. Make sure to leverage them in your...
Read more >Groovy reference documentation
This chapter covers the operators of the Groovy programming language. 1.2.1. Arithmetic operators. Groovy supports the usual familiar arithmetic operators you ...
Read more >Object orientation - The Apache Groovy programming language
Inheritance in Groovy resembles inheritance in Java. It provides a mechanism for a child class (or subclass) to reuse code or properties from...
Read more >Syntax - The Apache Groovy programming language
In addition, Groovy supports Runtime Groovydoc since 3.0.0, i.e. Groovydoc ... provided you have installed the Groovy distribution and the groovy command is ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi. I am unfortunately also not a groovy expert. Actually I just wanted to know more about gradle, so I also had a look at Groovy. When I started to write my first dummy plugins, I searched for a better way to format code automatically (still used ANT…), so I found spotless and try to learn from its source how to write gradle plugins. Since I found the p2.asmaven provided by @nedtwigg fascinating, I started to write a formatter step using the GrEclipse plugin. Anyhow, I am cleaning up my prove-of-concept and committing it step by step to my fork. Maybe (with some help 😉 ) I can manage to push it to a usable state within a few week(end)s.
Travis is working again.