Skip to content

Commit ba548d8

Browse files
committed
linter: docs for error message style
also remove some dead snapshots
1 parent 556f0d3 commit ba548d8

6 files changed

+36
-163
lines changed
Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,38 @@
11
# linter
22

3-
## rules
4-
5-
| name | done? |
6-
| -------------------------------------------- | ----- |
7-
| adding_field_with_default | y |
8-
| adding_foreign_key_constraint | y |
9-
| adding_not_null_field | y |
10-
| adding_primary_key_constraint | y |
11-
| adding_required_field | y |
12-
| ban_char_field | y |
13-
| ban_concurrent_index_creation_in_transaction | y |
14-
| ban_drop_column | y |
15-
| ban_drop_database | y |
16-
| ban_drop_not_null | y |
17-
| ban_drop_table | y |
18-
| changing_column_type | y |
19-
| constraint_missing_not_valid | y |
20-
| disallow_unique_constraint | y |
21-
| prefer_big_int | y |
22-
| prefer_bigint_over_int | y |
23-
| prefer_bigint_over_smallint | y |
24-
| prefer_identity | y |
25-
| prefer_robust_stmts | y |
26-
| prefer_text_field | y |
27-
| prefer_timestamptz | y |
28-
| renaming_column | y |
29-
| renaming_table | y |
30-
| require_concurrent_index_creation | y |
31-
| require_concurrent_index_deletion | y |
3+
## Error message style guide
4+
5+
### Lock messages
6+
7+
Each lock name should be:
8+
9+
- accompanied by an explanation of its meaning in simple terms
10+
- tables that are affected
11+
12+
Instead of:
13+
14+
```
15+
Changing the size of a `varchar` field requires an `ACCESS EXCLUSIVE` lock.
16+
```
17+
18+
include a lock description & table name:
19+
20+
```
21+
Changing the size of a `varchar` field requires an `ACCESS EXCLUSIVE` lock, which prevents reads and writes to `users`.
22+
```
23+
24+
### Help
25+
26+
A help message should be short an actionable.
27+
28+
Instead of:
29+
30+
```
31+
You can remove the `CASCADE` keyword and then specify exactly which tables you want to truncate directly.
32+
```
33+
34+
tell the user what to change (add, update, remove):
35+
36+
```
37+
Remove the `CASCADE` and specify exactly which tables you want to truncate.
38+
```

β€Žcrates/squawk_linter/src/rules/snapshots/squawk_linter__rules__prefer_big_int__test__alter_table_add_column_err.snapβ€Ž

Lines changed: 0 additions & 14 deletions
This file was deleted.

β€Žcrates/squawk_linter/src/rules/snapshots/squawk_linter__rules__prefer_big_int__test__alter_table_alter_column_type_err.snapβ€Ž

Lines changed: 0 additions & 14 deletions
This file was deleted.

β€Žcrates/squawk_linter/src/rules/snapshots/squawk_linter__rules__prefer_big_int__test__alter_table_alter_column_type_with_quotes_err.snapβ€Ž

Lines changed: 0 additions & 14 deletions
This file was deleted.

β€Žcrates/squawk_linter/src/rules/snapshots/squawk_linter__rules__prefer_big_int__test__create_table_many_err.snapβ€Ž

Lines changed: 0 additions & 22 deletions
This file was deleted.

β€Žcrates/squawk_linter/src/rules/snapshots/squawk_linter__rules__prefer_big_int__test__err.snapβ€Ž

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
Β (0)