mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-22 08:41:02 -05:00
Work on adding Java
This commit is contained in:
parent
808c70aaf6
commit
5b7cbb36eb
3 changed files with 26 additions and 6 deletions
|
@ -222,6 +222,7 @@ ENV GITHUB_SHA=${GITHUB_SHA} \
|
||||||
VALIDATE_KOTLIN=${VALIDATE_KOTLIN} \
|
VALIDATE_KOTLIN=${VALIDATE_KOTLIN} \
|
||||||
VALIDATE_DART=${VALIDATE_DART} \
|
VALIDATE_DART=${VALIDATE_DART} \
|
||||||
VALIDATE_POWERSHELL=${VALIDATE_POWERSHELL} \
|
VALIDATE_POWERSHELL=${VALIDATE_POWERSHELL} \
|
||||||
|
VALIDATE_JAVA=${VALIDATE_JAVA} \
|
||||||
VALIDATE_ARM=${VALIDATE_ARM} \
|
VALIDATE_ARM=${VALIDATE_ARM} \
|
||||||
VALIDATE_OPENAPI=${VALIDATE_OPENAPI} \
|
VALIDATE_OPENAPI=${VALIDATE_OPENAPI} \
|
||||||
VALIDATE_PROTOBUF=${VALIDATE_PROTOBUF} \
|
VALIDATE_PROTOBUF=${VALIDATE_PROTOBUF} \
|
||||||
|
|
|
@ -33,19 +33,21 @@ Developers on **GitHub** can call the **GitHub Action** to lint their code base
|
||||||
| *Language* | *Linter* |
|
| *Language* | *Linter* |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| **Ansible** | [ansible-lint](https://github.com/ansible/ansible-lint) |
|
| **Ansible** | [ansible-lint](https://github.com/ansible/ansible-lint) |
|
||||||
| **Azure Resource Manager (ARM)** | [arm-ttk](https://github.com/azure/arm-ttk) |
|
| **Azure Resource Manager (ARM)** | [arm-ttk](https://github.com/azure/arm-ttk) |
|
||||||
| **AWS CloudFormation templates** | [cfn-lint](https://github.com/aws-cloudformation/cfn-python-lint/) |
|
| **AWS CloudFormation templates** | [cfn-lint](https://github.com/aws-cloudformation/cfn-python-lint/) |
|
||||||
| **CSS** | [stylelint](https://stylelint.io/) |
|
| **CSS** | [stylelint](https://stylelint.io/) |
|
||||||
| **Clojure** | [clj-kondo](https://github.com/borkdude/clj-kondo) |
|
| **Clojure** | [clj-kondo](https://github.com/borkdude/clj-kondo) |
|
||||||
| **CoffeeScript** | [coffeelint](https://coffeelint.github.io/) |
|
| **CoffeeScript** | [coffeelint](https://coffeelint.github.io/) |
|
||||||
| **Dart** | [dartanalyzer](https://dart.dev/guides/language/analysis-options) |
|
| **Dart** | [dartanalyzer](https://dart.dev/guides/language/analysis-options) |
|
||||||
| **Dockerfile** | [dockerfilelint](https://github.com/replicatedhq/dockerfilelint.git) |
|
| **Dockerfile** | [dockerfilelint](https://github.com/replicatedhq/dockerfilelint.git) |
|
||||||
| **EDITORCONFIG** | [editorconfig-checker](https://github.com/editorconfig-checker/editorconfig-checker) |
|
| **EDITORCONFIG** | [editorconfig-checker](https://github.com/editorconfig-checker/editorconfig-checker) |
|
||||||
| **ENV** | [dotenv-linter](https://github.com/dotenv-linter/dotenv-linter) |
|
| **ENV** | [dotenv-linter](https://github.com/dotenv-linter/dotenv-linter) |
|
||||||
| **Golang** | [golangci-lint](https://github.com/golangci/golangci-lint) |
|
| **Golang** | [golangci-lint](https://github.com/golangci/golangci-lint) |
|
||||||
| **HTMLHint** | [HTMLHint](https://github.com/htmlhint/HTMLHint) |
|
| **HTMLHint** | [HTMLHint](https://github.com/htmlhint/HTMLHint) |
|
||||||
| **JavaScript** | [eslint](https://eslint.org/) [standard js](https://standardjs.com/) |
|
| **JavaScript** | [eslint](https://eslint.org/) [standard js](https://standardjs.com/) |
|
||||||
| **JSON** | [jsonlint](https://github.com/zaach/jsonlint) |
|
| **JSON** | [jsonlint](https://github.com/zaach/jsonlint) |
|
||||||
|
| **CSS** | [stylelint](https://stylelint.io/) |
|
||||||
|
| **Java** | [Spotless](https://github.com/diffplug/spotless) |
|
||||||
| **Kotlin** | [ktlint](https://github.com/pinterest/ktlint) |
|
| **Kotlin** | [ktlint](https://github.com/pinterest/ktlint) |
|
||||||
| **Markdown** | [markdownlint](https://github.com/igorshubovych/markdownlint-cli#readme) |
|
| **Markdown** | [markdownlint](https://github.com/igorshubovych/markdownlint-cli#readme) |
|
||||||
| **OpenAPI** | [spectral](https://github.com/stoplightio/spectral) |
|
| **OpenAPI** | [spectral](https://github.com/stoplightio/spectral) |
|
||||||
|
@ -183,6 +185,7 @@ and won't run anything unexpected.
|
||||||
| **VALIDATE_CSS** | `true` | Flag to enable or disable the linting process of the language. |
|
| **VALIDATE_CSS** | `true` | Flag to enable or disable the linting process of the language. |
|
||||||
| **VALIDATE_ENV** | `true` | Flag to enable or disable the linting process of the language. |
|
| **VALIDATE_ENV** | `true` | Flag to enable or disable the linting process of the language. |
|
||||||
| **VALIDATE_CLOJURE** | `true` | Flag to enable or disable the linting process of the language. |
|
| **VALIDATE_CLOJURE** | `true` | Flag to enable or disable the linting process of the language. |
|
||||||
|
| **VALIDATE_JAVA** | `true` | Flag to enable or disable the linting process of the language. |
|
||||||
| **VALIDATE_HTML** | `true` | Flag to enable or disable the linting process of the language. |
|
| **VALIDATE_HTML** | `true` | Flag to enable or disable the linting process of the language. |
|
||||||
| **VALIDATE_KOTLIN** | `true` | Flag to enable or disable the linting process of the language. |
|
| **VALIDATE_KOTLIN** | `true` | Flag to enable or disable the linting process of the language. |
|
||||||
| **VALIDATE_DART** | `true` | Flag to enable or disable the linting process of the language. |
|
| **VALIDATE_DART** | `true` | Flag to enable or disable the linting process of the language. |
|
||||||
|
|
|
@ -94,7 +94,7 @@ LINTER_ARRAY=("jsonlint" "yamllint" "xmllint" "markdownlint" "shellcheck"
|
||||||
"pylint" "perl" "raku" "rubocop" "coffeelint" "eslint" "standard"
|
"pylint" "perl" "raku" "rubocop" "coffeelint" "eslint" "standard"
|
||||||
"ansible-lint" "dockerfilelint" "golangci-lint" "tflint"
|
"ansible-lint" "dockerfilelint" "golangci-lint" "tflint"
|
||||||
"stylelint" "dotenv-linter" "pwsh" "arm-ttk" "ktlint" "protolint" "clj-kondo"
|
"stylelint" "dotenv-linter" "pwsh" "arm-ttk" "ktlint" "protolint" "clj-kondo"
|
||||||
"spectral" "cfn-lint" "dart" "htmlhint")
|
"spectral" "cfn-lint" "dart" "htmlhint" "spotless")
|
||||||
|
|
||||||
#############################
|
#############################
|
||||||
# Language array for prints #
|
# Language array for prints #
|
||||||
|
@ -103,7 +103,7 @@ LANGUAGE_ARRAY=('YML' 'JSON' 'XML' 'MARKDOWN' 'BASH' 'PERL' 'RAKU' 'PHP' 'RUBY'
|
||||||
'COFFEESCRIPT' 'ANSIBLE' 'JAVASCRIPT_STANDARD' 'JAVASCRIPT_ES' 'JSX' 'TSX'
|
'COFFEESCRIPT' 'ANSIBLE' 'JAVASCRIPT_STANDARD' 'JAVASCRIPT_ES' 'JSX' 'TSX'
|
||||||
'TYPESCRIPT_STANDARD' 'TYPESCRIPT_ES' 'DOCKER' 'GO' 'TERRAFORM'
|
'TYPESCRIPT_STANDARD' 'TYPESCRIPT_ES' 'DOCKER' 'GO' 'TERRAFORM'
|
||||||
'CSS' 'ENV' 'POWERSHELL' 'ARM' 'KOTLIN' 'PROTOBUF' 'CLOJURE' 'OPENAPI'
|
'CSS' 'ENV' 'POWERSHELL' 'ARM' 'KOTLIN' 'PROTOBUF' 'CLOJURE' 'OPENAPI'
|
||||||
'CFN' 'DART' 'HTML')
|
'CFN' 'DART' 'HTML' 'JAVA')
|
||||||
|
|
||||||
###################
|
###################
|
||||||
# GitHub ENV Vars #
|
# GitHub ENV Vars #
|
||||||
|
@ -142,12 +142,14 @@ VALIDATE_TERRAFORM="${VALIDATE_TERRAFORM}" # Boolean to vali
|
||||||
VALIDATE_POWERSHELL="${VALIDATE_POWERSHELL}" # Boolean to validate language
|
VALIDATE_POWERSHELL="${VALIDATE_POWERSHELL}" # Boolean to validate language
|
||||||
VALIDATE_ARM="${VALIDATE_ARM}" # Boolean to validate language
|
VALIDATE_ARM="${VALIDATE_ARM}" # Boolean to validate language
|
||||||
VALIDATE_KOTLIN="${VALIDATE_KOTLIN}" # Boolean to validate language
|
VALIDATE_KOTLIN="${VALIDATE_KOTLIN}" # Boolean to validate language
|
||||||
|
VALIDATE_JAVA="${VALIDATE_JAVA}" # Boolean to validate language
|
||||||
VALIDATE_OPENAPI="${VALIDATE_OPENAPI}" # Boolean to validate language
|
VALIDATE_OPENAPI="${VALIDATE_OPENAPI}" # Boolean to validate language
|
||||||
VALIDATE_DART="${VALIDATE_DART}" # Boolean to validate language
|
VALIDATE_DART="${VALIDATE_DART}" # Boolean to validate language
|
||||||
|
VALIDATE_HTML="${VALIDATE_HTML}" # Boolean to validate language
|
||||||
VALIDATE_EDITORCONFIG="${VALIDATE_EDITORCONFIG}" # Boolean to validate files with editorconfig
|
VALIDATE_EDITORCONFIG="${VALIDATE_EDITORCONFIG}" # Boolean to validate files with editorconfig
|
||||||
TEST_CASE_RUN="${TEST_CASE_RUN}" # Boolean to validate only test cases
|
TEST_CASE_RUN="${TEST_CASE_RUN}" # Boolean to validate only test cases
|
||||||
DISABLE_ERRORS="${DISABLE_ERRORS}" # Boolean to enable warning-only output without throwing errors
|
DISABLE_ERRORS="${DISABLE_ERRORS}" # Boolean to enable warning-only output without throwing errors
|
||||||
VALIDATE_HTML="${VALIDATE_HTML}" # Boolean to validate language
|
|
||||||
|
|
||||||
##############
|
##############
|
||||||
# Debug Vars #
|
# Debug Vars #
|
||||||
|
@ -217,6 +219,7 @@ FILE_ARRAY_ARM=() # Array of files to check
|
||||||
FILE_ARRAY_CSS=() # Array of files to check
|
FILE_ARRAY_CSS=() # Array of files to check
|
||||||
FILE_ARRAY_ENV=() # Array of files to check
|
FILE_ARRAY_ENV=() # Array of files to check
|
||||||
FILE_ARRAY_CLOJURE=() # Array of files to check
|
FILE_ARRAY_CLOJURE=() # Array of files to check
|
||||||
|
FILE_ARRAY_JAVA=() # Array of files to check
|
||||||
FILE_ARRAY_KOTLIN=() # Array of files to check
|
FILE_ARRAY_KOTLIN=() # Array of files to check
|
||||||
FILE_ARRAY_PROTOBUF=() # Array of files to check
|
FILE_ARRAY_PROTOBUF=() # Array of files to check
|
||||||
FILE_ARRAY_OPENAPI=() # Array of files to check
|
FILE_ARRAY_OPENAPI=() # Array of files to check
|
||||||
|
@ -253,6 +256,7 @@ ERRORS_FOUND_ARM=0 # Count of errors found
|
||||||
ERRORS_FOUND_CSS=0 # Count of errors found
|
ERRORS_FOUND_CSS=0 # Count of errors found
|
||||||
ERRORS_FOUND_ENV=0 # Count of errors found
|
ERRORS_FOUND_ENV=0 # Count of errors found
|
||||||
ERRORS_FOUND_CLOJURE=0 # Count of errors found
|
ERRORS_FOUND_CLOJURE=0 # Count of errors found
|
||||||
|
ERRORS_FOUND_JAVA=0 # Count of errors found
|
||||||
ERRORS_FOUND_KOTLIN=0 # Count of errors found
|
ERRORS_FOUND_KOTLIN=0 # Count of errors found
|
||||||
ERRORS_FOUND_PROTOBUF=0 # Count of errors found
|
ERRORS_FOUND_PROTOBUF=0 # Count of errors found
|
||||||
ERRORS_FOUND_OPENAPI=0 # Count of errors found
|
ERRORS_FOUND_OPENAPI=0 # Count of errors found
|
||||||
|
@ -831,6 +835,7 @@ Footer() {
|
||||||
[ "$ERRORS_FOUND_OPENAPI" -ne 0 ] ||
|
[ "$ERRORS_FOUND_OPENAPI" -ne 0 ] ||
|
||||||
[ "$ERRORS_FOUND_PROTOBUF" -ne 0 ] ||
|
[ "$ERRORS_FOUND_PROTOBUF" -ne 0 ] ||
|
||||||
[ "$ERRORS_FOUND_CLOJURE" -ne 0 ] ||
|
[ "$ERRORS_FOUND_CLOJURE" -ne 0 ] ||
|
||||||
|
[ "$ERRORS_FOUND_JAVA" -ne 0 ] ||
|
||||||
[ "$ERRORS_FOUND_KOTLIN" -ne 0 ] ||
|
[ "$ERRORS_FOUND_KOTLIN" -ne 0 ] ||
|
||||||
[ "$ERRORS_FOUND_DART" -ne 0 ] ||
|
[ "$ERRORS_FOUND_DART" -ne 0 ] ||
|
||||||
[ "$ERRORS_FOUND_HTML" -ne 0 ]; then
|
[ "$ERRORS_FOUND_HTML" -ne 0 ]; then
|
||||||
|
@ -1218,6 +1223,17 @@ if [ "$VALIDATE_ENV" == "true" ]; then
|
||||||
LintCodebase "ENV" "dotenv-linter" "dotenv-linter" ".*\.\(env\).*\$" "${FILE_ARRAY_ENV[@]}"
|
LintCodebase "ENV" "dotenv-linter" "dotenv-linter" ".*\.\(env\).*\$" "${FILE_ARRAY_ENV[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
################
|
||||||
|
# JAVA LINTING #
|
||||||
|
################
|
||||||
|
if [ "$VALIDATE_JAVA" == "true" ]; then
|
||||||
|
#######################
|
||||||
|
# Lint the JAVA files #
|
||||||
|
#######################
|
||||||
|
# LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY"
|
||||||
|
LintCodebase "JAVA" "spotless" "spotless" ".*\.\(java\)\$" "${FILE_ARRAY_JAVA[@]}"
|
||||||
|
fi
|
||||||
|
|
||||||
##################
|
##################
|
||||||
# KOTLIN LINTING #
|
# KOTLIN LINTING #
|
||||||
##################
|
##################
|
||||||
|
|
Loading…
Reference in a new issue