Skip to content

Commit

Permalink
build: update Dart, dart analyzer to 3.2.4 (#5065)
Browse files Browse the repository at this point in the history
Recent versions of dart analyzer don't support the --options
configuration option anymore, so we cannot pass an arbitrary
configuration file. This commit removes the default dart analyzer
configuration file as well, because it's not needed anymore.
  • Loading branch information
ferrarimarco committed Dec 26, 2023
1 parent 1dc74e1 commit 4d9eaa5
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 97 deletions.
16 changes: 9 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ FROM scalameta/scalafmt:v3.7.17 as scalafmt
FROM zricethezav/gitleaks:v8.18.1 as gitleaks
FROM yoheimuta/protolint:0.47.3 as protolint
FROM ghcr.io/clj-kondo/clj-kondo:2023.05.18-alpine as clj-kondo
FROM dart:3.2.4-sdk as dart

FROM python:3.12.1-alpine3.19 as base_image

Expand Down Expand Up @@ -221,6 +222,13 @@ RUN --mount=type=secret,id=GITHUB_TOKEN /install-glibc.sh && rm -rf /install-gli
#####################
COPY --from=clj-kondo /bin/clj-kondo /usr/bin/

####################
# Install dart-sdk #
####################
ENV DART_SDK /usr/lib/dart
COPY --from=dart "${DART_SDK}" "${DART_SDK}"
RUN chmod 755 "${DART_SDK}" && chmod 755 "${DART_SDK}/bin"

#################
# Install Lintr #
#################
Expand Down Expand Up @@ -259,13 +267,6 @@ RUN --mount=type=secret,id=GITHUB_TOKEN /install-ktlint.sh && rm -rf /install-kt
#################################################
RUN apk add --no-cache rakudo zef

####################
# Install dart-sdk #
####################
ARG DART_VERSION='2.8.4'
COPY scripts/install-dart-sdk.sh /
RUN /install-dart-sdk.sh && rm -rf /install-dart-sdk.sh

######################
# Install CheckStyle #
######################
Expand Down Expand Up @@ -320,6 +321,7 @@ ENV PATH="${PATH}:/venvs/yamllint/bin"
ENV PATH="${PATH}:/venvs/yq/bin"
ENV PATH="${PATH}:/node_modules/.bin"
ENV PATH="${PATH}:/usr/lib/go/bin"
ENV PATH="${PATH}:${DART_SDK}/bin:/root/.pub-cache/bin"

# Configure TFLint plugin folder
ENV TFLINT_PLUGIN_DIR="/root/.tflint.d/plugins"
Expand Down
57 changes: 0 additions & 57 deletions TEMPLATES/analysis_options.yml

This file was deleted.

9 changes: 9 additions & 0 deletions docs/upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ This document helps you upgrade from a super-linter version to newer ones:

This section helps you migrate from super-linter `v5` to `v6`.

### Dart

- super-linter doesn't include a default configuration file for `dart analyzer`
because the Dart SDK doesn't support running `dart analyzer` against an
arbitrary configuration file anymore. For more information about how to
customize static analysis of Dart files, see
[Customizing static analysis](https://dart.dev/tools/analysis) in the Dart SDK
documentation.

### Experimental batch workers

- Experimental batch support is deprecated. You can safely remove the
Expand Down
4 changes: 1 addition & 3 deletions lib/linter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ CLOUDFORMATION_FILE_NAME=".cfnlintrc.yml"
# shellcheck disable=SC2034 # Variable is referenced indirectly
COFFEESCRIPT_FILE_NAME=".coffee-lint.json"
CSS_FILE_NAME="${CSS_FILE_NAME:-.stylelintrc.json}"
# shellcheck disable=SC2034 # Variable is referenced indirectly
DART_FILE_NAME="analysis_options.yml"
DOCKERFILE_HADOLINT_FILE_NAME="${DOCKERFILE_HADOLINT_FILE_NAME:-.hadolint.yaml}"
EDITORCONFIG_FILE_NAME="${EDITORCONFIG_FILE_NAME:-.ecrc}"
# shellcheck disable=SC2034 # Variable is referenced indirectly
Expand Down Expand Up @@ -947,7 +945,7 @@ LINTER_COMMANDS_ARRAY['COFFEESCRIPT']="coffeelint -f ${COFFEESCRIPT_LINTER_RULES
LINTER_COMMANDS_ARRAY['CPP']="cpplint"
LINTER_COMMANDS_ARRAY['CSHARP']="dotnet format whitespace --folder --verify-no-changes --exclude / --include"
LINTER_COMMANDS_ARRAY['CSS']="stylelint --config ${CSS_LINTER_RULES}"
LINTER_COMMANDS_ARRAY['DART']="dartanalyzer --fatal-infos --fatal-warnings --options ${DART_LINTER_RULES}"
LINTER_COMMANDS_ARRAY['DART']="dart analyze --fatal-infos --fatal-warnings"
LINTER_COMMANDS_ARRAY['DOCKERFILE_HADOLINT']="hadolint -c ${DOCKERFILE_HADOLINT_LINTER_RULES}"
LINTER_COMMANDS_ARRAY['EDITORCONFIG']="editorconfig-checker -config ${EDITORCONFIG_LINTER_RULES}"
LINTER_COMMANDS_ARRAY['ENV']="dotenv-linter"
Expand Down
24 changes: 0 additions & 24 deletions scripts/install-dart-sdk.sh

This file was deleted.

1 change: 0 additions & 1 deletion test/inspec/super-linter/controls/super_linter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@
"/action/lib/.automation/.stylelintrc.json",
"/action/lib/.automation/.tflint.hcl",
"/action/lib/.automation/.yaml-lint.yml",
"/action/lib/.automation/analysis_options.yml",
"/action/lib/.automation/phpcs.xml",
"/action/lib/.automation/phpstan.neon",
"/action/lib/.automation/psalm.xml",
Expand Down
6 changes: 2 additions & 4 deletions test/linters/dart/dart_bad_1.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// empty_constructor_bodies bad {}
class Point {
int x, y;
Point(this.x, this.y) {}
void increment() {
count++;
}
1 change: 0 additions & 1 deletion test/linters/dart/dart_good_1.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// empty_constructor_bodies good ;
class Point {
int x, y;
Point(this.x, this.y);
Expand Down

0 comments on commit 4d9eaa5

Please sign in to comment.