A simple linter for dbt (Data Build Tool) projects, designed to help you maintain clean and consistent SQL code in your dbt models. formatforge
focuses on enforcing SQL style guidelines such as using leading commas, uppercase SQL keywords, and lowercase for everything else, ensuring your dbt project adheres to your business's specific coding standards.
formatforge
is built with Python and can be easily installed using Poetry. Ensure you have Poetry installed; if not, follow the installation instructions on the Poetry website.
To install formatforge
, clone the repository and run the following command within the cloned directory:
$ poetry add formatforge
This command creates a virtual environment and installs all necessary dependencies.
After installation, you can run formatforge
to lint your dbt project files. Here's a basic example:
$ formatforge uppercase path/to/your/model.sql
Replace path/to/your/model.sql
with the actual path to the SQL file you want to lint.
--file
: Specify the SQL file to lint.--uppercase
: Enable or disable uppercase SQL keywords. Default is enabled.--leading-comma
: Enable or disable leading commas. Default is enabled.
We welcome contributions to formatforge
! If you have suggestions for improvements or bug fixes, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or fix.
- Develop your changes and ensure they adhere to the project's coding standards.
- Submit a pull request with a clear description of your changes.
Please refer to CONTRIBUTING.md for more detailed information on contributing.
If you encounter any issues or have suggestions for improvements, please open an issue on GitHub with a detailed description of the problem or suggestion. Include any relevant details that could help us understand or reproduce the issue.
formatforge
is open source and available under the MIT License.