From 084c9beea2510d4e44b86133f84d76e86f6845e8 Mon Sep 17 00:00:00 2001 From: Jeremy Yeo Date: Mon, 8 Jan 2024 11:45:26 +1300 Subject: [PATCH 1/7] Update lint-format.md --- website/docs/docs/cloud/dbt-cloud-ide/lint-format.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md b/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md index 733ec9dbcfe..39d08731814 100644 --- a/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md +++ b/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md @@ -233,6 +233,11 @@ Make sure you're on a development branch. Formatting or Linting isn't available — If your lint operation passes despite clear rule violations, confirm you're not linting models with ephemeral models. Linting doesn't support ephemeral models in dbt v1.5 and lower. +
+What are some other known limitations with dbt Cloud linting? +— Currently, the dbt Cloud IDE can only lint or fix files up to a certain size and complexity. If you attempt to lint or fix files that are too large (which would take more than 60 seconds for the dbt Cloud backend to process), you will see an 'Unable to complete linting this file' error. Please break up your model into smaller models (files) so that they are less complex to lint or fix. +
+ ## Related docs - [User interface](/docs/cloud/dbt-cloud-ide/ide-user-interface) From dfbd33abe147d2171c7eb57be0ec56e54df1d042 Mon Sep 17 00:00:00 2001 From: Jeremy Yeo Date: Mon, 8 Jan 2024 11:49:22 +1300 Subject: [PATCH 2/7] Update lint-format.md --- website/docs/docs/cloud/dbt-cloud-ide/lint-format.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md b/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md index 39d08731814..e6e7ffb510b 100644 --- a/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md +++ b/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md @@ -235,7 +235,7 @@ Make sure you're on a development branch. Formatting or Linting isn't available
What are some other known limitations with dbt Cloud linting? -— Currently, the dbt Cloud IDE can only lint or fix files up to a certain size and complexity. If you attempt to lint or fix files that are too large (which would take more than 60 seconds for the dbt Cloud backend to process), you will see an 'Unable to complete linting this file' error. Please break up your model into smaller models (files) so that they are less complex to lint or fix. +— Currently, the dbt Cloud IDE can only lint or fix files up to a certain size and complexity. If you attempt to lint or fix files that are too large (which would take more than 60 seconds for the dbt Cloud backend to process), you will see an 'Unable to complete linting this file' error. Please break up your model into smaller models (files) so that they are less complex to lint or fix. Note that linting is less complex than fixing so you may run into a scenario where a file can be linted but not fixed.
## Related docs From 08ec779537e4c25a01e1c8d068bd756a8817307f Mon Sep 17 00:00:00 2001 From: mirnawong1 <89008547+mirnawong1@users.noreply.github.com> Date: Mon, 8 Jan 2024 10:08:49 +0000 Subject: [PATCH 3/7] Update lint-format.md turn to toggle --- .../docs/cloud/dbt-cloud-ide/lint-format.md | 39 ++++++++----------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md b/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md index e6e7ffb510b..4c565596804 100644 --- a/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md +++ b/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md @@ -14,7 +14,7 @@ Linters analyze code for errors, bugs, and style issues, while formatters fix st -In the dbt Cloud IDE, you have the capability to perform linting, auto-fix, and formatting on five different file types: +In the dbt Cloud IDE, you can perform linting, auto-fix, and formatting on five different file types: - SQL — [Lint](#lint) and fix with SQLFluff, and [format](#format) with sqlfmt - YAML, Markdown, and JSON — Format with Prettier @@ -146,7 +146,7 @@ The Cloud IDE formatting integrations take care of manual tasks like code format To format your SQL code, dbt Cloud integrates with [sqlfmt](http://sqlfmt.com/), which is an uncompromising SQL query formatter that provides one way to format the SQL query and Jinja. -By default, the IDE uses sqlfmt rules to format your code, making the **Format** button available and convenient to use right away. However, if you have a file named .sqlfluff in the root directory of your dbt project, the IDE will default to SQLFluff rules instead. +By default, the IDE uses sqlfmt rules to format your code, making the **Format** button available and convenient to use immediately. However, if you have a file named .sqlfluff in the root directory of your dbt project, the IDE will default to SQLFluff rules instead. To enable sqlfmt: @@ -189,10 +189,8 @@ To format your Python code, dbt Cloud integrates with [Black](https://black.read ## FAQs -
-When should I use SQLFluff and when should I use sqlfmt? - -SQLFluff and sqlfmt are both tools used for formatting SQL code, but there are some differences that may make one preferable to the other depending on your use case.
+ +SQLFluff and sqlfmt are both tools used for formatting SQL code, but some differences may make one preferable to the other depending on your use case.
SQLFluff is a SQL code linter and formatter. This means that it analyzes your code to identify potential issues and bugs, and follows coding standards. It also formats your code according to a set of rules, which are [customizable](#customize-linting), to ensure consistent coding practices. You can also use SQLFluff to keep your SQL code well-formatted and follow styling best practices.
@@ -204,19 +202,17 @@ You can use either SQLFluff or sqlfmt depending on your preference and what work - Use sqlfmt to only have your code well-formatted without analyzing it for errors and bugs. You can use sqlfmt out of the box, making it convenient to use right away without having to configure it. -
+ -
-Can I nest .sqlfluff files? + To ensure optimal code quality, consistent code, and styles — it's highly recommended you have one main `.sqlfluff` configuration file in the root folder of your project. Having multiple files can result in various different SQL styles in your project.

However, you can customize and include an additional child `.sqlfluff` configuration file within specific subfolders of your dbt project.

By nesting a `.sqlfluff` file in a subfolder, SQLFluff will apply the rules defined in that subfolder's configuration file to any files located within it. The rules specified in the parent `.sqlfluff` file will be used for all other files and folders outside of the subfolder. This hierarchical approach allows for tailored linting rules while maintaining consistency throughout your project. Refer to [SQLFluff documentation](https://docs.sqlfluff.com/en/stable/configuration.html#configuration-files) for more info. -
+ -
-Can I run SQLFluff commands from the terminal? + Currently, running SQLFluff commands from the terminal isn't supported.
@@ -225,18 +221,17 @@ Currently, running SQLFluff commands from the terminal isn't supported. Why am I unable to see the Lint or Format button? Make sure you're on a development branch. Formatting or Linting isn't available on "main" or "read-only" branches. - + -
-Why is there inconsistent SQLFluff behavior when running outside the dbt Cloud IDE (such as a GitHub Action)? -— Double-check your SQLFluff version matches the one in dbt Cloud IDE (found in the Code Quality tab after a lint operation).

-— If your lint operation passes despite clear rule violations, confirm you're not linting models with ephemeral models. Linting doesn't support ephemeral models in dbt v1.5 and lower. -
+ +- Double-check that your SQLFluff version matches the one in dbt Cloud IDE (found in the Code Quality tab after a lint operation).

+- If your lint operation passes despite clear rule violations, confirm you're not linting models with ephemeral models. Linting doesn't support ephemeral models in dbt v1.5 and lower. +
-
-What are some other known limitations with dbt Cloud linting? -— Currently, the dbt Cloud IDE can only lint or fix files up to a certain size and complexity. If you attempt to lint or fix files that are too large (which would take more than 60 seconds for the dbt Cloud backend to process), you will see an 'Unable to complete linting this file' error. Please break up your model into smaller models (files) so that they are less complex to lint or fix. Note that linting is less complex than fixing so you may run into a scenario where a file can be linted but not fixed. -
+ +Currently, the dbt Cloud IDE can lint or fix files up to a certain size and complexity. If you attempt to lint or fix files that are too large, taking more than 60 seconds for the dbt Cloud backend to process, you will see an 'Unable to complete linting this file' error. To avoid this, break up your model into smaller models (files) so that they are less complex to lint or fix. Note that linting is simpler than fixing so there may be cases where a file can be linted but not fixed. + + ## Related docs From e1ff8e2a2b0dc46ac1cb9b401e67ec87d4b780a4 Mon Sep 17 00:00:00 2001 From: mirnawong1 <89008547+mirnawong1@users.noreply.github.com> Date: Mon, 8 Jan 2024 10:15:33 +0000 Subject: [PATCH 4/7] Update lint-format.md --- website/docs/docs/cloud/dbt-cloud-ide/lint-format.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md b/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md index 4c565596804..98ec266d05f 100644 --- a/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md +++ b/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md @@ -210,18 +210,17 @@ To ensure optimal code quality, consistent code, and styles — it's highly However, you can customize and include an additional child `.sqlfluff` configuration file within specific subfolders of your dbt project.

By nesting a `.sqlfluff` file in a subfolder, SQLFluff will apply the rules defined in that subfolder's configuration file to any files located within it. The rules specified in the parent `.sqlfluff` file will be used for all other files and folders outside of the subfolder. This hierarchical approach allows for tailored linting rules while maintaining consistency throughout your project. Refer to [SQLFluff documentation](https://docs.sqlfluff.com/en/stable/configuration.html#configuration-files) for more info. - + Currently, running SQLFluff commands from the terminal isn't supported. - + -
-Why am I unable to see the Lint or Format button? + Make sure you're on a development branch. Formatting or Linting isn't available on "main" or "read-only" branches. - + - Double-check that your SQLFluff version matches the one in dbt Cloud IDE (found in the Code Quality tab after a lint operation).

From 9704965ae8472f1e3ba1df6c1ab1130d259082cd Mon Sep 17 00:00:00 2001 From: mirnawong1 <89008547+mirnawong1@users.noreply.github.com> Date: Mon, 8 Jan 2024 10:24:44 +0000 Subject: [PATCH 5/7] Update lint-format.md --- website/docs/docs/cloud/dbt-cloud-ide/lint-format.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md b/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md index 98ec266d05f..28d4f4d6a1a 100644 --- a/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md +++ b/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md @@ -204,7 +204,7 @@ You can use either SQLFluff or sqlfmt depending on your preference and what work
- + To ensure optimal code quality, consistent code, and styles — it's highly recommended you have one main `.sqlfluff` configuration file in the root folder of your project. Having multiple files can result in various different SQL styles in your project.

@@ -217,12 +217,12 @@ However, you can customize and include an additional child `.sqlfluff` configura Currently, running SQLFluff commands from the terminal isn't supported.
- + Make sure you're on a development branch. Formatting or Linting isn't available on "main" or "read-only" branches. - + - Double-check that your SQLFluff version matches the one in dbt Cloud IDE (found in the Code Quality tab after a lint operation).

- If your lint operation passes despite clear rule violations, confirm you're not linting models with ephemeral models. Linting doesn't support ephemeral models in dbt v1.5 and lower.
From fd25f896f5df09059e6065320cb041107a935894 Mon Sep 17 00:00:00 2001 From: mirnawong1 <89008547+mirnawong1@users.noreply.github.com> Date: Mon, 8 Jan 2024 10:25:13 +0000 Subject: [PATCH 6/7] Update website/docs/docs/cloud/dbt-cloud-ide/lint-format.md --- website/docs/docs/cloud/dbt-cloud-ide/lint-format.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md b/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md index 28d4f4d6a1a..0909e0d79ed 100644 --- a/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md +++ b/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md @@ -228,7 +228,9 @@ Make sure you're on a development branch. Formatting or Linting isn't available
-Currently, the dbt Cloud IDE can lint or fix files up to a certain size and complexity. If you attempt to lint or fix files that are too large, taking more than 60 seconds for the dbt Cloud backend to process, you will see an 'Unable to complete linting this file' error. To avoid this, break up your model into smaller models (files) so that they are less complex to lint or fix. Note that linting is simpler than fixing so there may be cases where a file can be linted but not fixed. +Currently, the dbt Cloud IDE can lint or fix files up to a certain size and complexity. If you attempt to lint or fix files that are too large, taking more than 60 seconds for the dbt Cloud backend to process, you will see an 'Unable to complete linting this file' error. + +To avoid this, break up your model into smaller models (files) so that they are less complex to lint or fix. Note that linting is simpler than fixing so there may be cases where a file can be linted but not fixed. From c8b3a4f83b84a75f9250fb3129aabd6ab543ea6f Mon Sep 17 00:00:00 2001 From: mirnawong1 <89008547+mirnawong1@users.noreply.github.com> Date: Mon, 8 Jan 2024 10:41:34 +0000 Subject: [PATCH 7/7] Update lint-format.md --- website/docs/docs/cloud/dbt-cloud-ide/lint-format.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md b/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md index 0909e0d79ed..f6f2265a922 100644 --- a/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md +++ b/website/docs/docs/cloud/dbt-cloud-ide/lint-format.md @@ -217,7 +217,7 @@ However, you can customize and include an additional child `.sqlfluff` configura Currently, running SQLFluff commands from the terminal isn't supported.
- + Make sure you're on a development branch. Formatting or Linting isn't available on "main" or "read-only" branches.