diff --git a/README.md b/README.md index 2c6b07e9..82c28b39 100644 --- a/README.md +++ b/README.md @@ -377,6 +377,7 @@ But if you wish to select or exclude specific linters, we give you full control | **VALIDATE_RUBY** | `true` | Flag to enable or disable the linting process of the Ruby language. | | **VALIDATE_RUST_2015** | `true` | Flag to enable or disable the linting process of the Rust language. (edition: 2015) | | **VALIDATE_RUST_2018** | `true` | Flag to enable or disable the linting process of Rust language. (edition: 2018) | +| **VALIDATE_RUST_2021** | `true` | Flag to enable or disable the linting process of Rust language. (edition: 2021) | | **VALIDATE_RUST_CLIPPY** | `true` | Flag to enable or disable the clippy linting process of Rust language. | | **VALIDATE_SCALAFMT_LINT** | `true` | Flag to enable or disable the linting process of Scala language. (Utilizing: scalafmt --test) | | **VALIDATE_SHELL_SHFMT** | `true` | Flag to enable or disable the linting process of Shell scripts. (Utilizing: shfmt) | diff --git a/lib/linter.sh b/lib/linter.sh index 16a42f73..221d9704 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -242,9 +242,10 @@ LANGUAGE_ARRAY=('ANSIBLE' 'ARM' 'BASH' 'BASH_EXEC' 'CLANG_FORMAT' 'OPENAPI' 'PERL' 'PHP_BUILTIN' 'PHP_PHPCS' 'PHP_PHPSTAN' 'PHP_PSALM' 'POWERSHELL' 'PROTOBUF' 'PYTHON_BLACK' 'PYTHON_PYLINT' 'PYTHON_FLAKE8' 'PYTHON_ISORT' 'PYTHON_MYPY' 'R' 'RAKU' 'RUBY' 'RUST_2015' 'RUST_2018' - 'RUST_CLIPPY' 'SCALAFMT' 'SHELL_SHFMT' 'SNAKEMAKE_LINT' 'SNAKEMAKE_SNAKEFMT' - 'STATES' 'SQL' 'SQLFLUFF' 'TEKTON' 'TERRAFORM_TFLINT' 'TERRAFORM_TERRASCAN' - 'TERRAGRUNT' 'TSX' 'TYPESCRIPT_ES' "${TYPESCRIPT_STYLE_NAME}" 'XML' 'YAML') + 'RUST_2021' 'RUST_CLIPPY' 'SCALAFMT' 'SHELL_SHFMT' 'SNAKEMAKE_LINT' + 'SNAKEMAKE_SNAKEFMT' 'STATES' 'SQL' 'SQLFLUFF' 'TEKTON' 'TERRAFORM_TFLINT' + 'TERRAFORM_TERRASCAN' 'TERRAGRUNT' 'TSX' 'TYPESCRIPT_ES' + "${TYPESCRIPT_STYLE_NAME}" 'XML' 'YAML') ############################## # Linter command names array # @@ -304,6 +305,7 @@ LINTER_NAMES_ARRAY['RAKU']="raku" LINTER_NAMES_ARRAY['RUBY']="rubocop" LINTER_NAMES_ARRAY['RUST_2015']="rustfmt" LINTER_NAMES_ARRAY['RUST_2018']="rustfmt" +LINTER_NAMES_ARRAY['RUST_2021']="rustfmt" LINTER_NAMES_ARRAY['RUST_CLIPPY']="clippy" LINTER_NAMES_ARRAY['SCALAFMT']="scalafmt" LINTER_NAMES_ARRAY['SHELL_SHFMT']="shfmt" @@ -757,7 +759,8 @@ UpdateLoopsForImage() { ############################################# # Need to remove linters for the slim image # ############################################# - REMOVE_ARRAY=("ARM" "CSHARP" "ENV" "POWERSHELL" "RUST_2015" "RUST_2018" "RUST_CLIPPY") + REMOVE_ARRAY=("ARM" "CSHARP" "ENV" "POWERSHELL" "RUST_2015" "RUST_2018" + "RUST_2021" "RUST_CLIPPY") # Remove from LANGUAGE_ARRAY echo "Removing Languages from LANGUAGE_ARRAY for slim image..." @@ -923,6 +926,7 @@ LINTER_COMMANDS_ARRAY['RAKU']="raku" LINTER_COMMANDS_ARRAY['RUBY']="rubocop -c ${RUBY_LINTER_RULES} --force-exclusion" LINTER_COMMANDS_ARRAY['RUST_2015']="rustfmt --check --edition 2015" LINTER_COMMANDS_ARRAY['RUST_2018']="rustfmt --check --edition 2018" +LINTER_COMMANDS_ARRAY['RUST_2021']="rustfmt --check --edition 2021" LINTER_COMMANDS_ARRAY['RUST_CLIPPY']="clippy" LINTER_COMMANDS_ARRAY['SCALAFMT']="scalafmt --config ${SCALAFMT_LINTER_RULES} --test" LINTER_COMMANDS_ARRAY['SHELL_SHFMT']="shfmt -d"