SQRUFF is an innovative SQL linter and formatter for modern development environments, written in Rust. Key features include:
- Linting: Advanced, customizable SQL linting capabilities to ensure query quality.
- Formatting: Automated, configurable formatting for SQL code consistency.
- Portability: Designed to be easily integrated into various development workflows.
You can use brew to install sqruff easily on macOS.
brew install quarylabs/quary/sqruff
Using bash
:
curl -fsSL https://raw.githubusercontent.com/quarylabs/sqruff/main/install.sh | bash
Either download the binary from the releases page or compile it yourself and with cargo with the following commands.
rustup override set nightly
cargo install sqruff
sqruff --help
To lint a SQL file or set of files, run the following command:
sqruff lint <file>
sqruff lint <file1> <file2> <file3>
sqruff lint <directory>
To fix a single or or set of files, run the following command:
sqruff fix <file/paths/directory>
To get help on the available commands and options, run the following command:
sqruff --help
Contributions are welcome! See CONTRIBUTING.md for guidelines on how to contribute.
- Bump the versions in
sqruff-lib/Cargo.toml
andsqruff/Cargo.toml
. - Commit the changes.
- Push the changes.
- Tag the commit with the new version
- Release
sqruff-lib
crate
cargo publish -p sqruff-lib
- Release
sqruff
crate
cargo publish -p sqruff
Join the sqruff community on GitHub Discussions to ask questions, suggest features, or share your projects.