pre-commit:
  commands:
    biome_check:
      glob: 'packages/**/*.{js,ts,json}'
      run: pnpm biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
      stage_fixed: true
      skip:
        - merge
        - rebase
    prettier_check:
      glob: 'packages/**/*.{vue,yml,md,css,scss}'
      run: pnpm prettier --write --ignore-unknown --no-error-on-unmatched-pattern {staged_files}
      stage_fixed: true
      skip:
        - merge
        - rebase
    styles_check:
      glob: 'packages/**/*.{scss,sass,vue}'
      run: pnpm lint:styles:fix
      skip:
        - merge
        - rebase
    actionlint_check:
      glob: '.github/workflows/*.{yml,yaml}'
      run: actionlint {staged_files}
      skip:
        - merge
        - rebase
    workspace_deps_check:
      glob: '**/package.json'
      run: node scripts/check-workspace-deps.mjs {staged_files}
      skip:
        - merge
        - rebase
    migration_timestamp_check:
      glob: 'packages/@n8n/db/src/migrations/{common,postgresdb,sqlite}/*.ts'
      run: |
        files=$(echo "{staged_files}" | tr ' ' ',')
        CODE_HEALTH_CHANGED_FILES="$files" pnpm --filter=@n8n/code-health check --rule=migration-timestamp
      skip:
        - merge
        - rebase
    playwright_janitor:
      glob: 'packages/testing/playwright/**/*.ts'
      run: |
        files=$(echo {staged_files} | tr ' ' ',')
        pnpm --filter=n8n-playwright janitor --files="$files"
      skip: true # Disabled for now - enable when baseline is committed
