Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

2.4 KB
Raw Blame
fail_fast: false

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v6.0.0
    hooks:
      - id: check-yaml
        exclude: ^pnpm-lock\.yaml$

  - repo: https://github.com/rhysd/actionlint
    rev: v1.7.12
    hooks:
      - id: actionlint
        args: [-ignore, SC]

  - repo: https://github.com/abravalheri/validate-pyproject
    rev: 'v0.27'
    hooks:
      - id: validate-pyproject

  - repo: https://github.com/igorshubovych/markdownlint-cli
    rev: v0.50.0
    hooks:
      - id: markdownlint-fix
        args: [-c, configs/.markdownlint.yaml, --fix, --disable, MD028]
        exclude: ^marimo/_tutorials/.*\.md

  - repo: https://github.com/crate-ci/typos
    rev: v1.51.1
    hooks:
      - id: typos
        pass_filenames: false

  - repo: local
    hooks:
      - id: no-double-backticks-in-docstrings
        name: no double backticks in docstrings
        entry: python scripts/check_docstring_backticks.py
        language: python
        types: [python]

  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.17.2
    hooks:
      # Run the linter
      - id: ruff-check
        args: [--fix]
      # Run the formatter
      - id: ruff-format

  # TODO: add back. this throws errors: thread 'tokio-rt-worker' (169) panicked at crates/oxc_allocator/src/pool/fixed_size.rs:112:67
  # - repo: https://github.com/oxc-project/mirrors-oxlint
  #   rev: v1.56.0
  #   hooks:
  #     - id: oxlint
  #       args: [--fix, --quiet]
  #       files: ^(frontend/src/|packages/)

  - repo: https://github.com/oxc-project/mirrors-oxfmt
    rev: v0.74.0
    hooks:
      - id: oxfmt
        args: [--write, --config, .oxfmtrc.json]
        files: ^(frontend/src/|packages/)
        "types_or": [javascript, jsx, ts, tsx]

  - repo: local
    hooks:
      - id: unique-test-filenames
        name: Enforce unique test filenames
        entry: bash -c 'if command -v uv >/dev/null 2>&1; then uv run python scripts/check_test_filenames.py; else python scripts/check_test_filenames.py; fi'
        language: system
        pass_filenames: false
        files: ^tests/.*\.py$
      - id: core-imports
        name: Check core imports
        entry: bash -c 'if command -v uv >/dev/null 2>&1; then uv run python scripts/check_core_imports.py; else python scripts/check_core_imports.py; fi'
        language: system
        pass_filenames: false
        files: ^marimo/_core/.*\.py$