Improve `format`, `lint`, and `test` commands to make pre-commit setup simple and more efficient

Offen
#6,020 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 4 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
python, sql
Bereich
cli, tooling

Rechercherichtung

Start by reading the sqlmesh format, sqlmesh lint, and sqlmesh test command entry points; the issue does not name specific files or tests. Check how each command handles file arguments and how the example pre-commit hooks invoke them. Done means all three commands accept filenames so pre-commit runs can be incremental.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Improvement

Parent issue for 5 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

Vorherrschende Sprache
Python
Sterne
3.3k
Forks
471
Ø Merge
6 T. 7 Std.
Gemergte PRs (30 T.)
35

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus SQLMesh/sqlmesh

Alle Issues in SQLMesh/sqlmesh

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.