From 483d46f8671030a2b2d31daf60675f278f0eb8ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20Juvenal?= Date: Wed, 29 Nov 2023 10:40:00 -0300 Subject: [PATCH] Fix pre-commit config --- .pre-commit-config.yaml | 84 ++++++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 39 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4de4aa06..82cdc0e9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,41 +1,47 @@ fail_fast: true repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 - hooks: - - id: check-added-large-files - args: ['--maxkb=500'] - exclude: > - (?x)^( - package-lock\.json - )$ - - id: fix-byte-order-marker - - id: check-case-conflict - - id: check-merge-conflict - - id: check-symlinks - - id: debug-statements - - id: detect-private-key - - repo: https://github.com/astral-sh/ruff-pre-commit - # Ruff version. - rev: v0.1.6 - hooks: - # Run the linter. - - id: ruff - args: [--fix] - # Run the formatter. - - id: ruff-format - - repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.54.0 - hooks: - - id: eslint - files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx - types: [file] - - repo: local - hooks: - - id: missing-migrations - name: missing-migrations-local - entry: poetry run python backend/manage.py makemigrations --check - language: system - # Only run missing migration check if migration-generating files have changed: - files: (.*/?(settings|migrations|models)/.+|.+models\.py|.+constants\.py|.+choices\.py|.+pyproject\.toml) - pass_filenames: false + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-added-large-files + args: ["--maxkb=500"] + exclude: > + (?x)^( + package-lock\.json + )$ + - id: fix-byte-order-marker + - id: check-case-conflict + - id: check-merge-conflict + - id: check-symlinks + - id: debug-statements + - id: detect-private-key + - repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.1.6 + hooks: + # Run the linter. + - id: ruff + args: [--fix] + # Run the formatter. + - id: ruff-format + - repo: local + hooks: + - id: eslint + name: eslint-local + entry: npm run lint + language: system + types: [javascript] + exclude: > + (?x)^( + .+\.config\.js| + .+\.setup\.js| + \.eslintrc\.js + )$ + pass_filenames: true + - id: missing-migrations + name: missing-migrations-local + entry: poetry run python backend/manage.py makemigrations --check + language: system + # Only run missing migration check if migration-generating files have changed: + files: (.*/?(settings|migrations|models)/.+|.+models\.py|.+constants\.py|.+choices\.py|.+pyproject\.toml) + pass_filenames: false