Overview
Features¶
What is Rulebook?
Library extension
A set of additional rules for static code analysis tools
Multiple languages
Originally written for Kotlin, it now supports Java, Groovy and Python
Features
Follows guidelines
Works together with standard rules from the linters and respects common coding convention
Shared configuration
Available in standard and Google Style Guide variants with adjusted defaults.
Compatibility table¶
Legend
The rule is fully implemented
Functionality already exists in other rules
The rule is already supported by the linter
Not supported due to technical limitations
Empty — not applicable to this language
Rule | Java | Groovy | Kotlin | Python |
---|---|---|---|---|
Block tag punctuation51 | ||||
Built-in types40 | ||||
Confusing predicate36 | ||||
Null equality45 | ||||
Redundant qualifier28 | ||||
TODO comment30 | ||||
Trailing comma in call46 | ||||
Trailing comma in collection55 | ||||
Trailing comma in declaration46 | ||||
Unused import8 | ||||
Wildcard import22 | ||||
format_text_clip Clipping group | Java | Groovy | Kotlin | Python |
Empty braces clip16 | ||||
Empty brackets clip3 | ||||
Empty parentheses clip3 | ||||
Empty tags clip3 | ||||
Short block comment clip35 | ||||
data_object Declaring group | Java | Groovy | Kotlin | Python |
Abstract class definition1 | ||||
Contract function definition39 | ||||
Exception inheritance53 | ||||
Number suffix for double25 | ||||
Number suffix for float25 | ||||
Number suffix for integer25 | ||||
Number suffix for long25 | ||||
String quotes18 | ||||
Unnecessary parentheses in lambda52 | ||||
Utility class definition4 | ||||
draft Formatting group | Java | Groovy | Kotlin | Python |
File size44 | ||||
Final newline14 | ||||
Indent style14 | ||||
Line length17 | ||||
label Naming group | Java | Groovy | Kotlin | Python |
Class name abbreviation31 | ||||
Class name48 | ||||
Constant property name48 | ||||
File name43 | ||||
Identifier name48 | ||||
Illegal class final name31 | ||||
Illegal variable name2 | ||||
Package name48 | ||||
Property name interop42 | ||||
Required generics name54 | ||||
swap_vert Ordering group | Java | Groovy | Kotlin | Python |
Block tag order10 | ||||
Built-in function position7 | ||||
Import order21 | ||||
Inner class position33 | ||||
Member order33 | ||||
Overload function position41 | ||||
Static import position21 | ||||
format_letter_spacing_2 Spacing group | Java | Groovy | Kotlin | Python |
Block comment spaces50 | ||||
Block tag indentation19 | ||||
Case separator34 | ||||
Comment spaces12 | ||||
Member separator24 | ||||
Missing blank line before block tags38 | ||||
code_blocks Stating group | Java | Groovy | Kotlin | Python |
Illegal catch53 | ||||
Illegal throw53 | ||||
Missing braces11 | ||||
Nested if-else26 | ||||
Redundant default27 | ||||
Redundant else27 | ||||
Unnecessary switch29 | ||||
format_letter_spacing_standard Trimming group | Java | Groovy | Kotlin | Python |
Block comment trim6 | ||||
Braces trim15 | ||||
Brackets trim9 | ||||
Comment trim6 | ||||
Duplicate blank line24 | ||||
Duplicate blank line in block comment6 | ||||
Duplicate blank line in comment6 | ||||
Duplicate space37 | ||||
Parentheses trim9 | ||||
Tags trim9 | ||||
Unnecessary blank line after colon15 | ||||
Unnecessary blank line before package23 | ||||
format_text_wrap Wrapping group | Java | Groovy | Kotlin | Python |
Assignment wrap20 | ||||
Chain call wrap47 | ||||
Elvis wrap5 | ||||
Infix call wrap13 | ||||
Lambda wrap20 | ||||
Operator wrap13 | ||||
Parameter wrap32 | ||||
Statement wrap49 |
Download¶
Integrate the linter tools
-
Java
Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard.
-
Groovy
CodeNarc is similar to popular static analysis tools such as PMD or Checkstyle.
-
Kotlin
An anti-bikeshedding Kotlin linter with built-in formatter.
-
Python
It's not just a linter that annoys you!
Download the library
-
Maven
JVM artifacts are available on Maven Central.
-
PyPI
The Python package is available on PyPI.