All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning.
0.15.0 - 2018-01-18
no-line-break-after-else
rule (#125).
kotlin-compiler
version to 1.2.20 (from 1.2.0) (#132).
0.14.0 - 2017-11-30
continuation_indent_size
to 4 when--android
profile is used (android/kotlin-guides#37).
- Maven integration (#117).
0.13.0 - 2017-11-28
no-line-break-before-assignment
(#105),
chain-wrapping
(#23) (when wrapping chained calls.
,?.
and?:
should be placed on the next line),
range-spacing
(no spaces around range (..
) operator) rules.--print-ast
CLI option which can be used to dump AST of the file
(see README / Creating a ruleset / AST for more details)--color
CLI option for colored output (where supported, e.g. --print-ast, default (plain) reporter, etc)
.editorconfig
property resolution.
An explicit[*.{kt,kts}]
is not required anymore (ktlint looks for sections containing*.kt
(or*.kts
) and will fallback to[*]
whenever property cannot be found elsewhere).
Also, a search for .editorconfig will no longer stop on first (closest).editorconfig
(unless it containsroot=true
).max-line-length
rule to assumemax_line_length=100
whenktlint --android ...
is used
(per Android Kotlin Style Guide).kotlin-compiler
version to 1.2.0 (from 1.1.51).
no-empty-class-body
auto-correction at the end of file (#109).max-line-length
rule when applied to KDoc (#112)
(previously KDoc was subject tomax-line-length
even though regular comments were not).- Spacing around
=
in @annotation|s (op-spacing
). - Spacing around generic type parameters of functions (e.g.
fun <T>f(): T {}
->fun <T> f(): T {}
). no-consecutive-blank-lines
not triggering at the end of file (when exactly 2 blank lines are present) (#108)indent
continuation_indent_size % indent_size != 0
case (#76)indent
rule skipping first parameter indentation check.final-newline
rule in the context of kotlin script.- Git hook (previously files containing space character (among others) in their names were ignored)
- Exit code when file cannot be linted due to the invalid syntax or internal error.
0.12.1 - 2017-11-13
- A conflict between
org.eclipse.aether:aether-*:1.1.0
andorg.eclipse.aether:aether-*:1.0.0.v20140518
(#100).
0.12.0 - 2017-11-10
--android
(-a
) CLI option (turns on Android Kotlin Style Guide compatibility)
(right now it's used only byktlint --apply-to-idea
).
ktlint --apply-to-idea
to account forindent_size
&continuation_indent_size
in.editorconfig
(if any).
ktlint-intellij-idea-integration
binary (deprecated in 0.9.0).
- "Unused import" false positive (
component1
..component5
).
0.11.1 - 2017-10-26
--reporter
'soutput
handling (previously parent directory was expected to exist) (#97).
0.11.0 - 2017-10-25
no-blank-line-before-rbrace
rule (#65).
- Redundant space inserted between
}
and::
(curly-spacing).
0.10.2 - 2017-10-25 [YANKED]
This release contains changes that were meant for 0.11.0 and so it was retagged as such.
0.10.1 - 2017-10-22
- Redundant space inserted between
}
and[key]
/(...)
(curly-spacing) (#91).
0.10.0 - 2017-10-10
- Git hook to automatically check files for style violations on commit
(executektlint --install-git-pre-commit-hook
to install). - Ability to specify multiple reporters
(output can be controlled with--reporter=<name>,output=<path/to/file>
) (#71). - Support for
indent_size=unset
(.editorconfig
) (#70).
( {
formatting
(previously both( {
and({
were accepted as correct, while only({
should be) (curly-spacing
rule) (#80).if\nfn {}\nelse
formatting (curly-spacing
rule).max_line_length=off
&max_line_length=unset
handling (.editorconfig
).
kotlin-compiler
version to 1.1.51 (from 1.1.3-2).ktlint --apply-to-idea
to includeOPTIMIZE_IMPORTS_ON_THE_FLY=true
.
0.9.2 - 2017-09-01
: Unit =
formatting (: Unit
is no longer dropped when=
is used) (#77).
0.9.1 - 2017-07-30
${super.toString()}
linting (string-template
rule) (#69).
0.9.0 - 2017-07-23
- Reporter API.
ktlint
comes with 3 built-in reporters:plain
(default;?group_by_file
can be appended to enable grouping by file (shown below)),json
andcheckstyle
.
$ ktlint --reporter=plain?group_by_file
path/to/file.kt
1:10 Unused import.
2:10 Unnecessary "Unit" return type.
path/to/another-file.kt
1:10 Unnecessary semicolon.
- string-template,
no-empty-class-body,
max-line-length (#47),
final-newline (activated only ifinsert_final_newline
is set in.editorconfig
(under[*.{kt,kts}]
)) rules. --limit
CLI option (e.g. use--limit=10
to limit the number of errors to display).--relative
CLI flag which makesktlint
output file paths relative to working directory (e.g.dir/file.kt
instead of/home/269/project/dir/file.kt
).
- BREAKING: JDK version to 1.8 (as a result of upgrading
kotlin-compiler
to 1.1.3-2 (from 1.1.0)). - File matching (offloaded to klob).
--ruleset-repository
and--ruleset-update
CLI arguments in favour of--repository
and--repository-update
respectively (--ruleset-*
will be removed in 1.0.0).ktlint-intellij-idea-integration
binary
(Intellij IDEA integration task is now included inktlint
(asktlint --apply-to-idea
)).
0.8.3 - 2017-06-19
- "Missing spacing after ";"" at the end of package declaration (#59).
- "Unused import" false positive (
setValue
) (#55). get
/set
ter spacing (#56).
0.8.2 - 2017-06-06
- "Unused import" false positive (
getValue
) (#54).
0.8.1 - 2017-05-30
ktlint --stdin
(#51).
0.8.0 - 2017-05-30
- .editorconfig support (right now only
indent_size
is honored and only if it's set in[*{kt,kts}]
section). - Support for vertically aligned comments (see NoMultipleSpacesRuleTest.kt).
- ktlint-ruleset-standard ("no-unit-return" & "modifier-order" where not included).
0.7.1 - 2017-05-29
- Triggering of "Unused import" when element is referenced in KDoc(s) only (#46).
0.7.0 - 2017-05-28
- no-unit-return rule.
- modifier-order rule (#42).
else/catch/finally
on the same line as}
check (now part of "keyword-spacing" rule).ktlint-intellij-idea-integration
binary for easy Intellij IDEA config injection.
0.6.2 - 2017-05-22
- Unused "iterator" extension function import false positive (#40).
0.6.1 - 2017-03-06
- Detection of unnecessary "same package" imports (no-unused-imports).
- FileNotFoundException while scanning FS (#36).
0.6.0 - 2017-03-01
kotlin-compiler
version to 1.1.0 (from 1.1-M04).
0.5.1 - 2017-02-28
- Unnecessary spacing around angle brackets in case of
super<T>
(#34).
0.5.0 - 2017-02-20
- Redundant space inserted between
}
and!!
(curly-spacing).
indent
rule to allow "Method declaration parameters -> Align when multiline" (as this option is (unfortunately) "on" by default in Intellij IDEA) (#26).
0.4.0 - 2017-02-01
- NPE in case of "Permission denied" (while scanning the file system).
kotlin-compiler
version to 1.1-M04 (from 1.0.6).
0.3.1 - 2017-01-25
- Unused infix function call import false positive (#25).
0.3.0 - 2017-01-11
*.kts
(script) support.
kotlin-compiler
version to 1.0.6 (from 1.0.3).
0.2.2 - 2016-10-11
no-wildcard-imports
rule (kotlinx.android.synthetic excluded from check) (#16).
0.2.1 - 2016-09-13
curly-spacing
false negative in case of}?.
.
0.2.0 - 2016-09-05
- Support for 3rd party "ruleset"s.
ktlint -F
output (it now includes lint errors that cannot be fixed automatically).
ktlint -F --debug
error count.- Glob implementation (previously it was prone to catastrophic backtracking).
- Redundant semicolon false positive in case of enum (#12).
- Unused operator import false positive (#13).
0.1.2 - 2016-08-05
- "in-use" escaped imports detection (#7) (no-unused-imports).
0.1.1 - 2016-08-01
- Incorrect spacing around curly braces (curly-spacing).