diff --git a/.github/config/super-linter.env b/.github/config/super-linter.env index 566f1bfb3..124022e92 100644 --- a/.github/config/super-linter.env +++ b/.github/config/super-linter.env @@ -2,42 +2,23 @@ FILTER_REGEX_EXCLUDE=mvnw|src/main/generated/.*|docs/themes/.*|keystore.pkcs12|. IGNORE_GITIGNORED_FILES=true JAVA_FILE_NAME=google_checks.xml LOG_LEVEL=ERROR -# conflicts with prettier -VALIDATE_BIOME_FORMAT=false -# conflicts with prettier -VALIDATE_BIOME_LINT=false -# disable kubernetes linter - complains about resource limits, etc -VALIDATE_CHECKOV=false -VALIDATE_CSS=false -VALIDATE_CSS_PRETTIER=false -VALIDATE_DOCKERFILE_HADOLINT=false -VALIDATE_GIT_COMMITLINT=false -# done by maven -VALIDATE_GOOGLE_JAVA_FORMAT=false -# times out -VALIDATE_GO_MODULES=false -VALIDATE_HTML=false -# done by checkstyle -VALIDATE_JAVA=false -# we have many duplicate code in our codebase for demo purposes -VALIDATE_JSCPD=false -VALIDATE_PYTHON_PYLINT=false -# conflicts with black -VALIDATE_PYTHON_RUFF_FORMAT=false -# excluding simpleclient-archive doesn't seem to work -VALIDATE_TRIVY=false -FIX_ENV=true -FIX_GITHUB_ACTIONS_ZIZMOR=true -FIX_GO=true -FIX_JAVASCRIPT_PRETTIER=true -FIX_JSON=true -FIX_JSONC=true -FIX_JSONC_PRETTIER=true +VALIDATE_BASH=true +VALIDATE_EDITORCONFIG=true +VALIDATE_GIT_MERGE_CONFLICT_MARKERS=true +VALIDATE_GITHUB_ACTIONS=true +VALIDATE_JSON_PRETTIER=true +VALIDATE_MARKDOWN=true +VALIDATE_MARKDOWN_PRETTIER=true +VALIDATE_RENOVATE=true +VALIDATE_SHELL_SHFMT=true +VALIDATE_SPELL_CODESPELL=true +VALIDATE_XML=true +VALIDATE_YAML_PRETTIER=true + FIX_JSON_PRETTIER=true FIX_MARKDOWN=true FIX_MARKDOWN_PRETTIER=true -FIX_PYTHON_BLACK=true FIX_SHELL_SHFMT=true FIX_SPELL_CODESPELL=true FIX_YAML_PRETTIER=true diff --git a/mise.toml b/mise.toml index 8956116a9..9c8713058 100644 --- a/mise.toml +++ b/mise.toml @@ -52,15 +52,26 @@ run = "./mvnw install -DskipTests -Dcoverage.skip=true" # Shared lint tasks from flint (https://github.com/grafana/flint) [tasks."lint:super-linter"] description = "Run Super-Linter on the repository" -file = "https://raw.githubusercontent.com/grafana/flint/0ac131d7832bd8964f6ca9e5af73207dca6a85ba/tasks/lint/super-linter.sh" # v0.7.1 +file = "https://raw.githubusercontent.com/grafana/flint/84e2d760286dead4e503315f9483a44fe872ee85/tasks/lint/super-linter.sh" # v0.8.0 [tasks."lint:links"] description = "Lint links" -file = "https://raw.githubusercontent.com/grafana/flint/0ac131d7832bd8964f6ca9e5af73207dca6a85ba/tasks/lint/links.sh" # v0.7.1 +file = "https://raw.githubusercontent.com/grafana/flint/84e2d760286dead4e503315f9483a44fe872ee85/tasks/lint/links.sh" # v0.8.0 [tasks."lint:renovate-deps"] description = "Verify renovate-tracked-deps.json is up to date" -file = "https://raw.githubusercontent.com/grafana/flint/0ac131d7832bd8964f6ca9e5af73207dca6a85ba/tasks/lint/renovate-deps.py" # v0.7.1 +file = "https://raw.githubusercontent.com/grafana/flint/84e2d760286dead4e503315f9483a44fe872ee85/tasks/lint/renovate-deps.py" # v0.8.0 + +[tasks."setup:native-lint-tools"] +description = "Install native lint tools matching the pinned super-linter version" +file = "https://raw.githubusercontent.com/grafana/flint/84e2d760286dead4e503315f9483a44fe872ee85/tasks/setup/native-lint-tools.sh" # v0.8.0 +[tasks.pre-commit] +description = "Pre-commit hook: native lint with autofix" +depends = ["setup:native-lint-tools"] +run = "mise run lint:super-linter -- --native --autofix" +[tasks."setup:pre-commit-hook"] +description = "Install git pre-commit hook that runs native linting" +run = "mise generate git-pre-commit --write --task=pre-commit" [tasks."lint"] description = "Run all lints"