Skip to content

Commit f80b44b

Browse files
authored
Chore: Fix linter docs for new command (#4057)
1 parent 09fcd4d commit f80b44b

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

docs/guides/linter.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,11 @@ class NoMissingOwner(Rule):
9898

9999
Place a rule's code in the project's `linter/` directory. SQLMesh will load all subclasses of `Rule` from that directory.
100100

101-
If the rule is specified in the project's [configuration file](#applying-linting-rules), SQLMesh will run it when the project is loaded. All SQLMesh commands will load the project, except for `create_external_models`, `migrate`, `rollback`, `run`, `environments`, and `invalidate`.
101+
If the rule is specified in the project's [configuration file](#applying-linting-rules), SQLMesh will run it when:
102+
- A plan is created during `sqlmesh plan`
103+
- The command `sqlmesh lint` is ran
102104

103-
SQLMesh will error if a model violates the rule, informing you which model(s) violated the rule. In this example, `full_model.sql` violated the `NoMissingOwner` rule:
105+
SQLMesh will error if a model violates the rule, informing you which model(s) violated the rule. In this example, `full_model.sql` violated the `NoMissingOwner` rule, essentially halting execution:
104106

105107
``` bash
106108
$ sqlmesh plan
@@ -111,6 +113,20 @@ Linter errors for .../models/full_model.sql:
111113
Error: Linter detected errors in the code. Please fix them before proceeding.
112114
```
113115

116+
Or through the standalone command, for faster iterations:
117+
118+
``` bash
119+
$ sqlmesh lint
120+
121+
Linter errors for .../models/full_model.sql:
122+
- nomissingowner: Model owner should always be specified.
123+
124+
Error: Linter detected errors in the code. Please fix them before proceeding.
125+
```
126+
127+
Use `sqlmesh lint --help` for more information.
128+
129+
114130
## Applying linting rules
115131

116132
Specify which linting rules a project should apply in the project's [configuration file](./configuration.md).

0 commit comments

Comments
 (0)