Skip to content

Commit c15ee6d

Browse files
authored
feat: support rust 2024 (#7211)
Add support for Rust 2024 Clost #7139
1 parent 0e09528 commit c15ee6d

14 files changed

Lines changed: 31 additions & 1 deletion

.github/linters/.jscpd.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"**/test/linters/rust_2015",
4141
"**/test/linters/rust_2018",
4242
"**/test/linters/rust_2021",
43+
"**/test/linters/rust_2024",
4344
"**/test/linters/scalafmt",
4445
"**/test/linters/typescript_es/**",
4546
"**/test/linters/typescript_prettier/**",

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ You can configure Super-linter using the following environment variables:
277277
| **FIX_RUST_2015** | `false` | Option to enable fix mode for `RUST_2015`. |
278278
| **FIX_RUST_2018** | `false` | Option to enable fix mode for `RUST_2018`. |
279279
| **FIX_RUST_2021** | `false` | Option to enable fix mode for `RUST_2021`. |
280+
| **FIX_RUST_2024** | `false` | Option to enable fix mode for `RUST_2024`. |
280281
| **FIX_RUST_CLIPPY** | `false` | Option to enable fix mode for `RUST_CLIPPY`. When `FIX_RUST_CLIPPY` is `true`, Clippy is allowed to fix issues in the workspace even if there are unstaged and staged changes in the workspace. |
281282
| **FIX_SCALAFMT** | `false` | Option to enable fix mode for `SCALAFMT`. |
282283
| **FIX_SHELL_SHFMT** | `false` | Option to enable fix mode for `SHELL_SHFMT`. |
@@ -446,6 +447,7 @@ You can configure Super-linter using the following environment variables:
446447
| **VALIDATE_RUST_2015** | `true` | Flag to enable or disable the linting process of the Rust language. (edition: 2015) |
447448
| **VALIDATE_RUST_2018** | `true` | Flag to enable or disable the linting process of Rust language. (edition: 2018) |
448449
| **VALIDATE_RUST_2021** | `true` | Flag to enable or disable the linting process of Rust language. (edition: 2021) |
450+
| **VALIDATE_RUST_2024** | `true` | Flag to enable or disable the linting process of Rust language. (edition: 2024) |
449451
| **VALIDATE_RUST_CLIPPY** | `true` | Flag to enable or disable the clippy linting process of Rust language. |
450452
| **VALIDATE_SCALAFMT** | `true` | Flag to enable or disable the linting process of Scala language. (Utilizing: scalafmt --test) |
451453
| **VALIDATE_SHELL_SHFMT** | `true` | Flag to enable or disable the linting process of Shell scripts. (Utilizing: shfmt) |

lib/functions/buildFileList.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,7 @@ BuildFileArrays() {
606606
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-RUST_2015"
607607
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-RUST_2018"
608608
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-RUST_2021"
609+
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-RUST_2024"
609610
elif [ "${BASE_FILE}" == "cargo.toml" ]; then
610611
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-RUST_CLIPPY"
611612
elif [ "${FILE_TYPE}" == "scala" ] || [ "${FILE_TYPE}" == "sc" ] || [ "${BASE_FILE}" == "??????" ]; then

lib/functions/linterCommands.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ LINTER_COMMANDS_ARRAY_RUBY=(rubocop -c "${RUBY_LINTER_RULES}" --force-exclusion
278278
LINTER_COMMANDS_ARRAY_RUST_2015=(rustfmt --edition 2015)
279279
LINTER_COMMANDS_ARRAY_RUST_2018=(rustfmt --edition 2018)
280280
LINTER_COMMANDS_ARRAY_RUST_2021=(rustfmt --edition 2021)
281+
LINTER_COMMANDS_ARRAY_RUST_2024=(rustfmt --edition 2024)
281282
LINTER_COMMANDS_ARRAY_RUST_CLIPPY=(cargo clippy)
282283
if [ -n "${RUST_CLIPPY_COMMAND_OPTIONS:-}" ]; then
283284
export RUST_CLIPPY_COMMAND_OPTIONS

lib/globals/languages.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ LANGUAGE_ARRAY=('ANSIBLE' 'ARM' 'BASH' 'BASH_EXEC'
4949
'PYTHON_FLAKE8' 'PYTHON_ISORT' 'PYTHON_MYPY' 'PYTHON_RUFF'
5050
"PYTHON_RUFF_FORMAT"
5151
'R' 'RENOVATE' 'RUBY' 'RUST_2015'
52-
'RUST_2018' 'RUST_2021' 'RUST_CLIPPY' 'SCALAFMT' 'SHELL_SHFMT'
52+
'RUST_2018' 'RUST_2021'
53+
"RUST_2024"
54+
'RUST_CLIPPY' 'SCALAFMT' 'SHELL_SHFMT'
5355
'SNAKEMAKE_LINT' 'SNAKEMAKE_SNAKEFMT' 'STATES' 'SQLFLUFF'
5456
'TERRAFORM_FMT' 'TERRAFORM_TFLINT' 'TERRAFORM_TERRASCAN' 'TERRAGRUNT'
5557
"TRIVY"

lib/globals/linterCommandsOptions.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ PYTHON_RUFF_FORMAT_CHECK_ONLY_MODE_OPTIONS=(--check)
3434
RUST_2015_CHECK_ONLY_MODE_OPTIONS=("${RUSTFMT_CHECK_ONLY_MODE_OPTIONS[@]}")
3535
RUST_2018_CHECK_ONLY_MODE_OPTIONS=("${RUSTFMT_CHECK_ONLY_MODE_OPTIONS[@]}")
3636
RUST_2021_CHECK_ONLY_MODE_OPTIONS=("${RUSTFMT_CHECK_ONLY_MODE_OPTIONS[@]}")
37+
RUST_2024_CHECK_ONLY_MODE_OPTIONS=("${RUSTFMT_CHECK_ONLY_MODE_OPTIONS[@]}")
3738
SCALAFMT_CHECK_ONLY_MODE_OPTIONS=(--test)
3839
SHELL_SHFMT_CHECK_ONLY_MODE_OPTIONS=(--diff)
3940
SNAKEMAKE_SNAKEFMT_CHECK_ONLY_MODE_OPTIONS=(--check --compact-diff)

lib/linter.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ UpdateLoopsForImage() {
576576
"RUST_2015"
577577
"RUST_2018"
578578
"RUST_2021"
579+
"RUST_2024"
579580
"RUST_CLIPPY"
580581
)
581582

scripts/linterVersions.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ if [[ "${IMAGE}" == "standard" ]]; then
109109
LINTER_NAMES_ARRAY['RUST_2015']="rustfmt"
110110
LINTER_NAMES_ARRAY['RUST_2018']="rustfmt"
111111
LINTER_NAMES_ARRAY['RUST_2021']="rustfmt"
112+
LINTER_NAMES_ARRAY['RUST_2024']="rustfmt"
112113
LINTER_NAMES_ARRAY['RUST_CLIPPY']="clippy"
113114
fi
114115

test/data/super-linter-summary/markdown/table/expected-summary-test-linters-expect-failure-standard.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
| RUST_2015 | Fail ❌ |
8787
| RUST_2018 | Fail ❌ |
8888
| RUST_2021 | Fail ❌ |
89+
| RUST_2024 | Fail ❌ |
8990
| RUST_CLIPPY | Fail ❌ |
9091
| SCALAFMT | Fail ❌ |
9192
| SHELL_SHFMT | Fail ❌ |

test/data/super-linter-summary/markdown/table/expected-summary-test-linters-expect-success-standard.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
| RUST_2015 | Pass ✅ |
8787
| RUST_2018 | Pass ✅ |
8888
| RUST_2021 | Pass ✅ |
89+
| RUST_2024 | Pass ✅ |
8990
| RUST_CLIPPY | Pass ✅ |
9091
| SCALAFMT | Pass ✅ |
9192
| SHELL_SHFMT | Pass ✅ |

0 commit comments

Comments
 (0)