Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix typo from IntentStyle to IndentStyle in EditorConfig #511

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -5,9 +5,9 @@ package com.pinterest.ktlint.core
*/
interface EditorConfig {

enum class IntentStyle { SPACE, TAB }
enum class IndentStyle { SPACE, TAB }

val indentStyle: IntentStyle
val indentStyle: IndentStyle
val indentSize: Int
val tabWidth: Int
val maxLineLength: Int
@@ -17,8 +17,8 @@ interface EditorConfig {
companion object {
fun fromMap(map: Map<String, String>): EditorConfig {
val indentStyle = when {
map["indent_style"]?.toLowerCase() == "tab" -> IntentStyle.TAB
else -> IntentStyle.SPACE
map["indent_style"]?.toLowerCase() == "tab" -> IndentStyle.TAB
else -> IndentStyle.SPACE
}
val indentSize = map["indent_size"].let { v ->
if (v?.toLowerCase() == "unset") -1 else v?.toIntOrNull() ?: 4
Original file line number Diff line number Diff line change
@@ -131,7 +131,7 @@ class IndentationRule : Rule("indent"), Rule.Modifier.RestrictToRootLast {
emit: (offset: Int, errorMessage: String, canBeAutoCorrected: Boolean) -> Unit
) {
val editorConfig = node.getUserData(KtLint.EDITOR_CONFIG_USER_DATA_KEY)!!
if (editorConfig.indentStyle == EditorConfig.IntentStyle.TAB || editorConfig.indentSize <= 1) {
if (editorConfig.indentStyle == EditorConfig.IndentStyle.TAB || editorConfig.indentSize <= 1) {
return
}
reset()