Skip to content

Improve format, lint, and test commands to make pre-commit setup simpler and more efficient #6020

Description

@cmgoffena13

Parent issue for 3 improvements to empower pre-commits using sqlmesh

sqlmesh format already takes multiple file paths and can intake filenames.

Goal is to have a simple pre-commit be efficient:

repos:
  - repo: local
    hooks:
      - id: sqlmesh-format
        name: sqlmesh format
        entry: sqlmesh format
        language: system
        files: '^(models|audits)/.*\.sql$'
      - id: sqlmesh-lint
        name: sqlmesh lint
        entry: sqlmesh lint --local --use-project-index
        language: system
        files: '^models/.*\.(sql|py)$'
      - id: sqlmesh-test
        name: sqlmesh test
        entry: sqlmesh test --local --use-project-index
        language: system
        files: '^(models/.*\.(sql|py)|tests/.*\.(yaml|yml))$'

To have each command intake filenames for incremental and efficient pre-commits

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ImprovementImproves existing functionality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions