|
1 | 1 | # linter |
2 | 2 |
|
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 | +``` |
0 commit comments