Home
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
How does it work?
flowchart LR
subgraph "Project"
src(Source code)
config[Config files]
end
subgraph "Static analysis"
linters[Linter libraries]
extensions[Rule extensions]
end
subgraph "Report"
cli[Build failure<br>on lint errors]
ide[Live warnings]
end
subgraph "Refactor"
manual(Manual edits<br>using suggestions)
end
src -- run --> linters
linters -- CLI --> cli
linters -- IDE --> ide
cli -- fix --> manual
ide -- fix --> manual
Compatibility table¶
| Rule | Java | Groovy | Kotlin | C/C++ | Python | JavaScript | TypeScript |
|---|---|---|---|---|---|---|---|
| Block tag punctuation71 | |||||||
| TODO comment47 | |||||||
| Trailing comma in call65 | |||||||
| Trailing comma in collection76 | |||||||
| Trailing comma in declaration65 | |||||||
| Unused import46 | |||||||
| Wildcard import26 | |||||||
| format_text_clip Clipping group | Java | Groovy | Kotlin | C/C++ | Python | JavaScript | TypeScript |
| Block comment clip52 | |||||||
| Braces clip19 | |||||||
| Brackets clip3 | |||||||
| Parentheses clip3 | |||||||
| Tags clip3 | |||||||
| data_object Declaring group | Java | Groovy | Kotlin | C/C++ | Python | JavaScript | TypeScript |
| Deprecated type57 | |||||||
| Double quotes in block comment75 | |||||||
| Internal error73 | |||||||
| Lowercase d33 | |||||||
| Lowercase f33 | |||||||
| Lowercase Hexadecimal20 | |||||||
| Lowercase i33 | |||||||
| Missing inline in contract55 | |||||||
| Missing private constructor5 | |||||||
| Redundant qualifier39 | |||||||
| Single quotes in literal22 | |||||||
| Unnecessary abstract1 | |||||||
| Unnecessary parentheses in lambda72 | |||||||
| Uppercase L33 | |||||||
| regular_expression Expressing group | Java | Groovy | Kotlin | C/C++ | Python | JavaScript | TypeScript |
| Complicated boolean equality41 | |||||||
| Complicated size equality42 | |||||||
| Confusing predicate8 | |||||||
| Deprecated identity64 | |||||||
| Redundant equality36 | |||||||
| Redundant equals36 | |||||||
| draft Formatting group | Java | Groovy | Kotlin | C/C++ | Python | JavaScript | TypeScript |
| Empty file4 | |||||||
| File size63 | |||||||
| Indent style17 | |||||||
| Line feed17 | |||||||
| Line length21 | |||||||
| Trailing newline17 | |||||||
| Unnecessary trailing space17 | |||||||
| label Naming group | Java | Groovy | Kotlin | C/C++ | Python | JavaScript | TypeScript |
| Abbreviation as word48 | |||||||
| Boolean property interoperability60 | |||||||
| Class name68 | |||||||
| Constant name68 | |||||||
| File name62 | |||||||
| Generic name74 | |||||||
| Identifier name68 | |||||||
| Illegal variable name2 | |||||||
| Meaningless word48 | |||||||
| Package name68 | |||||||
| swap_vert Ordering group | Java | Groovy | Kotlin | C/C++ | Python | JavaScript | TypeScript |
| Block tag order13 | |||||||
| Common function position67 | |||||||
| Import order25 | |||||||
| Inner class position50 | |||||||
| Member order50 | |||||||
| Modifier order58 | |||||||
| Named import order9 | |||||||
| Overload function position59 | |||||||
| Static import position67 | |||||||
| terminal Scripting group | Java | Groovy | Kotlin | C/C++ | Python | JavaScript | TypeScript |
| Decentralized dependency29 | |||||||
| Eager API30 | |||||||
| Lonely configuration12 | |||||||
| Root project name31 | |||||||
| Script file name32 | |||||||
| format_letter_spacing_2 Spacing group | Java | Groovy | Kotlin | C/C++ | Python | JavaScript | TypeScript |
| Block comment spaces70 | |||||||
| Block tag indentation23 | |||||||
| Case separator51 | |||||||
| Comment spaces15 | |||||||
| Member separator28 | |||||||
| Missing blank line before block tags54 | |||||||
| code_blocks Stating group | Java | Groovy | Kotlin | C/C++ | Python | JavaScript | TypeScript |
| Complicated assignment34 | |||||||
| Illegal catch73 | |||||||
| Illegal throw73 | |||||||
| Lonely case43 | |||||||
| Lonely if11 | |||||||
| Missing braces14 | |||||||
| Nested if-else35 | |||||||
| Redundant default38 | |||||||
| Redundant else38 | |||||||
| Redundant if37 | |||||||
| Semicolon61 | |||||||
| Unnecessary continue44 | |||||||
| Unnecessary return45 | |||||||
| bug_report Testing group | Java | Groovy | Kotlin | C/C++ | Python | JavaScript | TypeScript |
| Complicated assertion40 | |||||||
| Confusing assertion8 | |||||||
| Deprecated annotation56 | |||||||
| format_letter_spacing_standard Trimming group | Java | Groovy | Kotlin | C/C++ | Python | JavaScript | TypeScript |
| Block comment trim7 | |||||||
| Braces trim18 | |||||||
| Brackets trim10 | |||||||
| Comment trim7 | |||||||
| Duplicate blank line28 | |||||||
| Duplicate blank line in block comment7 | |||||||
| Duplicate blank line in comment7 | |||||||
| Duplicate space53 | |||||||
| Parentheses trim10 | |||||||
| Tags trim10 | |||||||
| Unnecessary blank line after colon18 | |||||||
| Unnecessary leading blank line27 | |||||||
| format_text_wrap Wrapping group | Java | Groovy | Kotlin | C/C++ | Python | JavaScript | TypeScript |
| Assignment wrap24 | |||||||
| Chain call wrap66 | |||||||
| Elvis wrap6 | |||||||
| Infix call wrap16 | |||||||
| Lambda wrap24 | |||||||
| Operator wrap16 | |||||||
| Parameter wrap49 | |||||||
| Statement wrap69 |
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.
- : Feature currently unexplored.
- Empty: not applicable to this language.
Download¶
Get the artifacts from official package managers.
Download the library
Integration¶
The main linter libraries can be downloaded using package managers. Preferrably, use IDE plugins to instantly see the issues while coding.
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.
-
C C++
A tool for static C/C++ code analysis.
-
Python
It's not just a linter that annoys you!
-
JavaScript TypeScript
Find and fix problems in your JavaScript code.