Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
runleonarun authored Dec 24, 2024
1 parent a2ee20f commit 934a1fb
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions website/docs/reference/commands/clean.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,33 @@ sidebar_label: "clean"
id: "clean"
---

`dbt clean` is a utility function that deletes the paths specified within the [`clean-targets`](/reference/project-configs/clean-targets) section of the `dbt_project.yml` file. It helps to remove any unnecessary files or directories generated during the execution of other DBT commands, ensuring a clean state for the project.
`dbt clean` is a utility function that deletes the paths specified within the [`clean-targets`](/reference/project-configs/clean-targets) list in the `dbt_project.yml` file. It helps by removing unnecessary files or directories generated during the execution of other dbt commands, ensuring a clean state for the project.

**Usage**
## Example usage
```
dbt clean
```

## Supported flags
### --clean-project-files-only (default)

Check warning on line 15 in website/docs/reference/commands/clean.md

View workflow job for this annotation

GitHub Actions / Vale linting

[vale] reported by reviewdog 🐶 [custom.SentenceCaseHeaders] '--clean-project-files-only (default)' should use sentence-style capitalization. Try 'Clean project files only default' instead. Raw Output: {"message": "[custom.SentenceCaseHeaders] '--clean-project-files-only (default)' should use sentence-style capitalization. Try 'Clean project files only default' instead.", "location": {"path": "website/docs/reference/commands/clean.md", "range": {"start": {"line": 15, "column": 5}}}, "severity": "WARNING"}
Deletes all the paths within the project directory that are specified in the `clean-targets` section.
Deletes all the paths within the project directory specified in `clean-targets`.

> **NOTE:** If the `clean-targets` section contains paths outside the DBT project, this command will lead to a _Runtime Error_ to indicate the same.
:::note
Avoid using paths outside the dbt project; otherwise, you will see an error.
:::


**Usage:**
#### Example usage
```
$ dbt clean --clean-project-files-only
```

### --no-clean-project-files-only

Check warning on line 28 in website/docs/reference/commands/clean.md

View workflow job for this annotation

GitHub Actions / Vale linting

[vale] reported by reviewdog 🐶 [custom.SentenceCaseHeaders] '--no-clean-project-files-only' should use sentence-style capitalization. Try 'No clean project files only' instead. Raw Output: {"message": "[custom.SentenceCaseHeaders] '--no-clean-project-files-only' should use sentence-style capitalization. Try 'No clean project files only' instead.", "location": {"path": "website/docs/reference/commands/clean.md", "range": {"start": {"line": 28, "column": 5}}}, "severity": "WARNING"}
Deletes all the paths specified in the `clean-targets` section of `dbt_project.yml`, including those outside the current DBT project.
Deletes all the paths specified in the `clean-targets` list of `dbt_project.yml`, including those outside the current dbt project.

```
$ dbt clean --no-clean-project-files-only
```

## dbt clean with remote file system
To avoid complex permissions issues and potentially deleting crucial aspects of the remote file system without access to fix them, this command does not work when interfacing with the RPC server that powers the DBT Cloud IDE. Instead, when working in DBT Cloud, the `dbt deps` command cleans before it installs packages automatically. The `target` folder can be manually deleted from the sidebar file tree if needed.
To avoid complex permissions issues and potentially deleting crucial aspects of the remote file system without access to fix them, this command does not work when interfacing with the RPC server that powers the dbt Cloud IDE. Instead, when working in dbt Cloud, the `dbt deps` command cleans before it installs packages automatically. The `target` folder can be manually deleted from the sidebar file tree if needed.

0 comments on commit 934a1fb

Please sign in to comment.