Contributions are welcome! See CONTRIBUTING.md for guidelines on how to contribute.
The project requires Rust version specified in rust-toolchain.tomlwhich you can set up with rustup, as well as a Python environment setup as shown below.
You'll also need to set up a python virtualenv and install dependencies as follows:
virtualenv .venv
source .venv/bin/activate
make python_syncOnce you have that the following runs the test suite.
make rust_testmake python_testBuild release wheels and a source distribution for the current platform:
bazel build //:python_distArtifacts are written to bazel-bin/python_dist/wheels and
bazel-bin/python_dist/sdist. Check wheel installation, extension imports, and
the installed CLI on Python 3.14, 3.14t, 3.15, and 3.15t:
bazel test //:python_wheel_checkBazel downloads the Python runtimes and pinned maturin build tools, and caches
the release build separately from the installation tests. The build uses
vendored Cargo dependencies; the wheel installation tests run offline with no
source fallback. Both targets run as part of the normal //... CI checks.
The Python release workflow also builds the full platform matrix and publishes
the release artifacts.
Run the following command to set up your VS Code environment using the recommended settings:
make load_vscode_settings- Bump the versions in
sqruff-lib/Cargo.tomlandsqruff/Cargo.toml. - Commit the changes.
- Push the changes.
- Tag the commit with the new version
- Release
sqruff-libcrate
cargo publish -p sqruff-lib- Release
sqruffcrate
cargo publish -p sqruffTo run the extension locally, install npm in the editors/code directory and run the following commands:
npm run build:wasm_lsp && npm run compile && npm run run-in-browserOne of the big set of tests that exist in the codebase are those to ensure the parsing of the SQL dialects is correct. These tests are stored in crates/lib/test/fixtures/dialects and there is a folder for each dialect. In each folder there is an a set of sql files and an accompanying yaml file that contains the expected output of parsing the sql file. To update the yaml files, run the tests with the UPDATE_EXPECT environment variable set to 1.
env UPDATE_EXPECT=1 cargo test