Skip to content

Commit

Permalink
Add Android support for Kotlin (super-linter#2670)
Browse files Browse the repository at this point in the history
* Fix Kotlin good test case (incorrect filename)

* Add Android support for Kotlin

Co-authored-by: Lukas Gravley <admiralawkbar@github.com>
  • Loading branch information
alexandrefavre4 and admiralAwkbar committed Mar 24, 2022
1 parent aee503c commit edc7095
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 0 deletions.
File renamed without changes.
9 changes: 9 additions & 0 deletions .automation/test/kotlin_android/kotlin_android_bad_1.kt
@@ -0,0 +1,9 @@
import pkg.PkgClass
import java.JavaClass

fun main(str1: String, str2: String, str3: String) {
val j = JavaClass()
val p = PkgClass()

println(p)
}
9 changes: 9 additions & 0 deletions .automation/test/kotlin_android/kotlin_android_good_1.kt
@@ -0,0 +1,9 @@
import java.JavaClass
import pkg.PkgClass

fun main(str1: String, str2: String, str3: String) {
val j = JavaClass()
val p = PkgClass()

println(p)
}
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -365,6 +365,7 @@ But if you wish to select or exclude specific linters, we give you full control
| **VALIDATE_JSON** | `true` | Flag to enable or disable the linting process of the JSON language. |
| **VALIDATE_JSX** | `true` | Flag to enable or disable the linting process for jsx files (Utilizing: eslint) |
| **VALIDATE_KOTLIN** | `true` | Flag to enable or disable the linting process of the Kotlin language. |
| **VALIDATE_KOTLIN_ANDROID** | `true` | Flag to enable or disable the linting process of the Kotlin language. (Utilizing: `ktlint --android`) |
| **VALIDATE_KUBERNETES_KUBEVAL** | `true` | Flag to enable or disable the linting process of Kubernetes descriptors with Kubeval |
| **VALIDATE_LATEX** | `true` | Flag to enable or disable the linting process of the LaTeX language. |
| **VALIDATE_LUA** | `true` | Flag to enable or disable the linting process of the language. |
Expand Down
1 change: 1 addition & 0 deletions lib/functions/buildFileList.sh
Expand Up @@ -562,6 +562,7 @@ function BuildFileList() {
# Append the file to the array #
################################
FILE_ARRAY_KOTLIN+=("${FILE}")
FILE_ARRAY_KOTLIN_ANDROID+=("${FILE}")

#####################
# Get the LUA files #
Expand Down
2 changes: 2 additions & 0 deletions lib/linter.sh
Expand Up @@ -290,6 +290,7 @@ LINTER_NAMES_ARRAY['JSON']="eslint"
LINTER_NAMES_ARRAY['JSONC']="eslint"
LINTER_NAMES_ARRAY['JSX']="eslint"
LINTER_NAMES_ARRAY['KOTLIN']="ktlint"
LINTER_NAMES_ARRAY['KOTLIN_ANDROID']="ktlint"
LINTER_NAMES_ARRAY['KUBERNETES_KUBEVAL']="kubeval"
LINTER_NAMES_ARRAY['LATEX']="chktex"
LINTER_NAMES_ARRAY['LUA']="lua"
Expand Down Expand Up @@ -908,6 +909,7 @@ LINTER_COMMANDS_ARRAY['JSON']="eslint --no-eslintrc -c ${JAVASCRIPT_ES_LINTER_RU
LINTER_COMMANDS_ARRAY['JSONC']="eslint --no-eslintrc -c ${JAVASCRIPT_ES_LINTER_RULES} --ext .json5,.jsonc"
LINTER_COMMANDS_ARRAY['JSX']="eslint --no-eslintrc -c ${JSX_LINTER_RULES}"
LINTER_COMMANDS_ARRAY['KOTLIN']="ktlint"
LINTER_COMMANDS_ARRAY['KOTLIN_ANDROID']="ktlint --android"
if [ "${KUBERNETES_KUBEVAL_OPTIONS}" == "null" ] || [ -z "${KUBERNETES_KUBEVAL_OPTIONS}" ]; then
LINTER_COMMANDS_ARRAY['KUBERNETES_KUBEVAL']="kubeval --strict"
else
Expand Down

0 comments on commit edc7095

Please sign in to comment.