feat: global sql linting
This commit is contained in:
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -43,9 +43,7 @@ jobs:
|
|||||||
run: uv sync
|
run: uv sync
|
||||||
|
|
||||||
- name: SQLFluff lint
|
- name: SQLFluff lint
|
||||||
run:
|
run: uv run sqlfluff lint dbt/models data_platform/ --dialect postgres
|
||||||
uv run sqlfluff lint dbt/models data_platform/assets/ingestion/funda/sql --dialect
|
|
||||||
postgres
|
|
||||||
|
|
||||||
lint-yaml-json-md:
|
lint-yaml-json-md:
|
||||||
name: Prettier (YAML / JSON / Markdown)
|
name: Prettier (YAML / JSON / Markdown)
|
||||||
|
|||||||
@@ -14,12 +14,19 @@ repos:
|
|||||||
language: system
|
language: system
|
||||||
types: [python]
|
types: [python]
|
||||||
|
|
||||||
|
- id: sqlfluff-fix
|
||||||
|
name: sqlfluff fix
|
||||||
|
entry: uv run sqlfluff fix --force --dialect postgres
|
||||||
|
language: system
|
||||||
|
types: [sql]
|
||||||
|
exclude: ^(dbt/target/|dbt/dbt_packages/)
|
||||||
|
|
||||||
- id: sqlfluff-lint
|
- id: sqlfluff-lint
|
||||||
name: sqlfluff lint
|
name: sqlfluff lint
|
||||||
entry: uv run sqlfluff lint --dialect postgres
|
entry: uv run sqlfluff lint --dialect postgres
|
||||||
language: system
|
language: system
|
||||||
types: [sql]
|
types: [sql]
|
||||||
files: ^(dbt/models/|data_platform/assets/ingestion/)
|
exclude: ^(dbt/target/|dbt/dbt_packages/)
|
||||||
|
|
||||||
- id: prettier
|
- id: prettier
|
||||||
name: prettier
|
name: prettier
|
||||||
|
|||||||
6
Makefile
6
Makefile
@@ -92,8 +92,8 @@ lint-python: ## Ruff lint + format check
|
|||||||
uv run ruff check .
|
uv run ruff check .
|
||||||
uv run ruff format --check .
|
uv run ruff format --check .
|
||||||
|
|
||||||
lint-sql: ## SQLFluff lint on dbt/models and ingestion SQL
|
lint-sql: ## SQLFluff lint all SQL (excl. dbt vendor/target dirs)
|
||||||
uv run sqlfluff lint dbt/models data_platform/assets/ingestion/funda/sql --dialect postgres
|
uv run sqlfluff lint dbt/models data_platform/ --dialect postgres
|
||||||
|
|
||||||
lint-format: ## Prettier check (YAML / Markdown)
|
lint-format: ## Prettier check (YAML / Markdown)
|
||||||
npx --yes prettier --check "**/*.yml" "**/*.yaml" "**/*.md" \
|
npx --yes prettier --check "**/*.yml" "**/*.yaml" "**/*.md" \
|
||||||
@@ -102,7 +102,7 @@ lint-format: ## Prettier check (YAML / Markdown)
|
|||||||
lint-fix: ## Auto-fix all linters (ruff + sqlfluff + prettier)
|
lint-fix: ## Auto-fix all linters (ruff + sqlfluff + prettier)
|
||||||
uv run ruff check --fix .
|
uv run ruff check --fix .
|
||||||
uv run ruff format .
|
uv run ruff format .
|
||||||
uv run sqlfluff fix dbt/models data_platform/assets/ingestion/funda/sql --dialect postgres
|
uv run sqlfluff fix dbt/models data_platform/ --dialect postgres
|
||||||
npx --yes prettier --write "**/*.yml" "**/*.yaml" "**/*.md" \
|
npx --yes prettier --write "**/*.yml" "**/*.yaml" "**/*.md" \
|
||||||
--ignore-path .prettierignore
|
--ignore-path .prettierignore
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user