add dart pub get and --fatal flags

- add `pub get || true`
- add --fatal flags to throw 1 on exit

Adding `pub get` enables dart to import dev/project dependencies before
analysis/linting. It is set to always return true in the event this has
already occured somewhere else in the CI workflow a pubspec.yaml does not
exist

Using `--fatal-(infos|warnings)` allows super-linter to fail when a lint
is reported.
This commit is contained in:
Casey Vega 2020-07-14 23:36:22 -07:00
parent abf0bdbf66
commit 95f0c2d534
No known key found for this signature in database
GPG key ID: 2E831CEB696E297C
2 changed files with 2 additions and 2 deletions

View file

@ -1185,7 +1185,7 @@ if [ "$VALIDATE_DART" == "true" ]; then
# Lint the Dart files #
#######################
# LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY"
LintCodebase "DART" "dart" "dartanalyzer --options $DART_LINTER_RULES" ".*\.\(dart\)\$" "${FILE_ARRAY_DART[@]}"
LintCodebase "DART" "dart" "pub get || true && dartanalyzer --fatal-infos --fatal-warnings --options $DART_LINTER_RULES" ".*\.\(dart\)\$" "${FILE_ARRAY_DART[@]}"
fi
##################

View file

@ -479,7 +479,7 @@ function RunTestCases() {
TestCodebase "KOTLIN" "ktlint" "ktlint" ".*\.\(kt\|kts\)\$" "kotlin"
TestCodebase "PROTOBUF" "protolint" "protolint lint --config_path $PROTOBUF_LINTER_RULES" ".*\.\(proto\)\$" "protobuf"
TestCodebase "OPENAPI" "spectral" "spectral lint -r $OPENAPI_LINTER_RULES" ".*\.\(ymlopenapi\|jsonopenapi\)\$" "openapi"
TestCodebase "DART" "dart" "dartanalyzer --fatal-infos --options $DART_LINTER_RULES" ".*\.\(dart\)\$" "dart"
TestCodebase "DART" "dart" "dartanalyzer --fatal-infos --fatal-warnings --options $DART_LINTER_RULES" ".*\.\(dart\)\$" "dart"
TestCodebase "HTML" "htmlhint" "htmlhint --config $HTML_LINTER_RULES" ".*\.\(html\)\$" "html"
#################