Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Test fixtures are read byte for byte (offsets, accepted findings), so every platform checks out LF.
**/tests/fixtures/** text eol=lf
4 changes: 3 additions & 1 deletion .github/scripts/release_metadata_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
)
# Files that may not exist before the first release.
OPTIONAL_BASE_PATHS: frozenset[str] = frozenset({CHANGELOG_PATH})
OWNED_CARGO_PACKAGES: frozenset[str] = frozenset({"sqlclean", "sqlclean-cli"})
OWNED_CARGO_PACKAGES: frozenset[str] = frozenset(
{"sqlclean", "sqlclean-cli", "sqlclean-lint", "sqlclean-rules"}
)
OWNED_UV_PACKAGES: frozenset[str] = frozenset({"sqlclean", "sqlclean-cli"})
ALLOWED_PATHS: frozenset[str] = frozenset((*VERSION_PATHS, CHANGELOG_PATH))
# The TOML table holding the owned version field in each manifest.
Expand Down
167 changes: 132 additions & 35 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
members = [
"crates/sqlclean",
"crates/sqlclean-cli",
"crates/sqlclean-lint",
"crates/sqlclean-rules",
]
resolver = "2"

Expand Down Expand Up @@ -29,13 +31,16 @@ serde_json = { version = "1", features = ["preserve_order"] }
sha2 = "0.10"
similar = "2"
sqlclean = { path = "crates/sqlclean" }
# SQLQuack's formatter and lint engine, and the tokens and trees they read, which replace Polyglot.
sqlquack-fingerprint = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "fe3d1caf5ed81981abf8abd1d00cc9d99462e6ed", features = ["bigquery", "databricks", "duckdb", "postgres", "snowflake", "sqlite", "sqlserver"] }
sqlquack-format = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "fe3d1caf5ed81981abf8abd1d00cc9d99462e6ed", features = ["bigquery", "databricks", "duckdb", "postgres", "snowflake", "sqlserver"] }
sqlquack-lint = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "fe3d1caf5ed81981abf8abd1d00cc9d99462e6ed", features = ["bigquery", "databricks", "duckdb", "postgres", "snowflake", "sqlite"] }
sqlquack-parse = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "fe3d1caf5ed81981abf8abd1d00cc9d99462e6ed" }
sqlquack-syntax = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "fe3d1caf5ed81981abf8abd1d00cc9d99462e6ed" }
sqlquack-syntax-sqlserver = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "fe3d1caf5ed81981abf8abd1d00cc9d99462e6ed" }
sqlclean-lint = { path = "crates/sqlclean-lint", features = ["bigquery", "databricks", "duckdb", "postgres", "snowflake", "sqlite"] }
sqlclean-rules = { path = "crates/sqlclean-rules" }
# SQLQuack's formatter, and the tokens and trees it and the lint Rules read, which replace Polyglot.
sqlquack-fingerprint = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174", features = ["bigquery", "databricks", "duckdb", "postgres", "snowflake", "sqlite", "sqlserver"] }
sqlquack-format = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174", features = ["bigquery", "databricks", "duckdb", "postgres", "snowflake", "sqlserver"] }
sqlquack-parse = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
sqlquack-semantics = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
sqlquack-syntax = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
sqlquack-tokenize = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }
sqlquack-syntax-sqlserver = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "7a8501afa69eb846637e4eb85604d6726fc33174" }

[workspace.lints.rust]
unsafe_code = "forbid"
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SHELL := /bin/bash

.PHONY: check check-ci check-docs-skill check-rust develop-native release-rehearsal skills test test-e2e test-integration test-rust test-unit verify
.PHONY: accept-lint-corpus check check-ci check-docs-skill check-rust develop-native release-rehearsal skills test test-e2e test-integration test-rust test-unit verify

check:
uv run ruff format .
Expand All @@ -20,6 +20,10 @@ check-ci:
check-docs-skill:
uv run python -m scripts.check_docs_skill

# Rewrites the lint corpus's accepted findings from the current engine; read and commit the diff.
accept-lint-corpus:
SQLCLEAN_ACCEPT_LINT_CORPUS=1 cargo test -p sqlclean-lint --lib --quiet lint_corpus

release-rehearsal:
bash .github/scripts/simulate_release.sh

Expand All @@ -28,6 +32,9 @@ skills:

check-rust:
cargo fmt --check
@# The Rules read trees only: no crate they reach may tokenize or parse SQL.
@if cargo tree -p sqlclean-rules -e normal --prefix none | grep -E '^sqlquack-(tokenize|parse|syntax-)'; then \
echo "sqlclean-rules must not reach a tokenizer or parser" >&2; exit 1; fi
cargo clippy --all-targets --quiet -- -D warnings

develop-native:
Expand Down
Loading
Loading