fix(dev/ci): pre-commit fixes galore (#32352)

This commit is contained in:
Evan Rusackas
2025-02-24 11:26:45 -07:00
committed by GitHub
parent c583eec4c7
commit 90651dfe3e
91 changed files with 3435 additions and 2142 deletions

View File

@@ -20,7 +20,7 @@ repos:
hooks:
- id: auto-walrus
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
rev: v1.15.0
hooks:
- id: mypy
args: [--check-untyped-defs]
@@ -52,27 +52,37 @@ repos:
- id: trailing-whitespace
exclude: ^.*\.(snap)
args: ["--markdown-linebreak-ext=md"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8 # Use the sha or tag you want to point at
hooks:
- id: prettier
additional_dependencies:
- prettier@3.3.3
args: ["--ignore-path=./superset-frontend/.prettierignore"]
files: "superset-frontend"
- repo: local
hooks:
- id: eslint
name: eslint
entry: ./scripts/eslint.sh
language: script
- id: prettier
name: prettier
entry: bash -c 'cd superset-frontend && if [ -z "$SKIP_FIX" ]; then npm run format -- --log-level error; else npm run prettier-check; fi'
language: system
files: '^superset-frontend/(src|spec|cypress-base|plugins|packages|.storybook)/.+\.(js|jsx|ts|tsx|css|less|scss|sass)$|^superset-frontend/package\.json$'
pass_filenames: true
files: ^superset-frontend\/.*\.(js|jsx|ts|tsx)$
- id: eslint-frontend
name: eslint (frontend)
entry: bash -c 'cd superset-frontend && if [ -z "$SKIP_FIX" ]; then npm run lint-fix; else npm run eslint; fi'
language: system
pass_filenames: true
files: ^superset-frontend/.*\.(js|jsx|ts|tsx)$
# TODO - re-assess using this script-based linting rather than the npm command. Both approaches have their merits
# - id: eslint
# name: eslint
# entry: ./scripts/eslint.sh
# language: script
# pass_filenames: true
# files: ^superset-frontend\/.*\.(js|jsx|ts|tsx)$
- id: eslint-docs
name: eslint (docs)
entry: bash -c 'cd docs && FILES=$(echo "$@" | sed "s|docs/||g") && yarn eslint --ext .js,.jsx,.ts,.tsx --quiet $([ -z "$SKIP_FIX" ] && echo "--fix") $FILES'
language: system
pass_filenames: true
files: ^docs/.*\.(js|jsx|ts|tsx)$
- id: type-checking-frontend
name: Type-Checking (Frontend)
entry: ./scripts/check-type.js
args: [package=superset-frontend, excludeDeclarationDir=cypress-base]
language: node
entry: bash -c './scripts/check-type.js package=superset-frontend excludeDeclarationDir=cypress-base'
language: system
files: ^superset-frontend\/.*\.(js|jsx|ts|tsx)$
exclude: ^superset-frontend/cypress-base\/
require_serial: true
@@ -87,8 +97,10 @@ repos:
hooks:
- id: helm-docs
files: helm
verbose: false
args: ["--log-level", "error"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.0
rev: v0.9.7
hooks:
- id: ruff
args: [--fix]