squawk-cli 0.8.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/package.json +1 -1
- package/CHANGELOG.md +0 -197
package/README.md
CHANGED
|
@@ -124,6 +124,22 @@ Here's an example comment created by `squawk` using the `example.sql` in the rep
|
|
|
124
124
|
|
|
125
125
|
See the ["GitHub Integration" docs](https://squawkhq.com/docs/github_app) for more information.
|
|
126
126
|
|
|
127
|
+
## `pre-commit` hook
|
|
128
|
+
|
|
129
|
+
Integrate Squawk into Git workflow with [pre-commit](https://pre-commit.com/). Add the following
|
|
130
|
+
to your project's `.pre-commit-config.yaml`:
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
repos:
|
|
134
|
+
- repo: https://github.com/sbdchd/squawk
|
|
135
|
+
rev: v0.10.0
|
|
136
|
+
hooks:
|
|
137
|
+
- id: squawk
|
|
138
|
+
files: path/to/postres/migrations/written/in/sql
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Note the `files` parameter as it specifies the location of the files to be linted.
|
|
142
|
+
|
|
127
143
|
## prior art
|
|
128
144
|
|
|
129
145
|
- <https://github.com/erik/squabble>
|
|
@@ -133,6 +149,7 @@ See the ["GitHub Integration" docs](https://squawkhq.com/docs/github_app) for mo
|
|
|
133
149
|
- <https://github.com/yandex/zero-downtime-migrations>
|
|
134
150
|
- <https://github.com/tbicr/django-pg-zero-downtime-migrations>
|
|
135
151
|
- <https://github.com/3YOURMIND/django-migration-linter>
|
|
152
|
+
- <https://github.com/ankane/strong_migrations>
|
|
136
153
|
|
|
137
154
|
## related blog posts / SE Posts / PG Docs
|
|
138
155
|
|
package/package.json
CHANGED
package/CHANGELOG.md
DELETED
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
## [Unreleased]
|
|
9
|
-
|
|
10
|
-
## v0.8.1 - 2021-11-30
|
|
11
|
-
|
|
12
|
-
### Fixed
|
|
13
|
-
|
|
14
|
-
- copy pasta of rename-table into the ban-drop-column rule (#168)
|
|
15
|
-
- parsing an index without a name specified (#169)
|
|
16
|
-
|
|
17
|
-
## v0.8.0 - 2021-10-31
|
|
18
|
-
|
|
19
|
-
### Fixed
|
|
20
|
-
|
|
21
|
-
- false positives with disallowed-unique-constraint and adding-serial-primary-key-field. Thanks @qoelet! (#161)
|
|
22
|
-
|
|
23
|
-
## v0.7.3 - 2021-08-11
|
|
24
|
-
|
|
25
|
-
### Fixed
|
|
26
|
-
|
|
27
|
-
- false positives with require-concurrent-index rule (#157)
|
|
28
|
-
|
|
29
|
-
## v0.7.2 - 2021-08-02
|
|
30
|
-
|
|
31
|
-
### Fixed
|
|
32
|
-
|
|
33
|
-
- incorrect internal schema for "alter table" statements with function calls. Thanks @qoelet! (#154)
|
|
34
|
-
|
|
35
|
-
## v0.7.1 - 2021-05-30
|
|
36
|
-
|
|
37
|
-
### Fixed
|
|
38
|
-
|
|
39
|
-
- incorrect internal schema for "create partition" statements. (#146)
|
|
40
|
-
- `upload-to-github` command not obeying top level `--exclude`s. (#142)
|
|
41
|
-
|
|
42
|
-
### Changed
|
|
43
|
-
|
|
44
|
-
- allowing adding not null column with default for `adding-not-null-field`. (#144)
|
|
45
|
-
|
|
46
|
-
## v0.7.0 - 2021-05-19
|
|
47
|
-
|
|
48
|
-
### Added
|
|
49
|
-
|
|
50
|
-
- link to website for tty reporter when there are lint errors. (#120)
|
|
51
|
-
- `DROP INDEX` support for "require-concurrent-index-creation" and "prefer-robust-stmts". (#124)
|
|
52
|
-
- github comment now includes Squawk's version number. (#131)
|
|
53
|
-
- new `ban-drop-column` rule (#132)
|
|
54
|
-
|
|
55
|
-
### Changed
|
|
56
|
-
|
|
57
|
-
- updated "adding-not-null-field" to warn about making a column non-nullable with `NOT NULL`. See the ["adding-not-null-field" docs](https://squawkhq.com/docs/adding-not-nullable-field) for more information. (#101)
|
|
58
|
-
|
|
59
|
-
### Fixed
|
|
60
|
-
|
|
61
|
-
- false positive with `prefer-text-field` that wasn't allowing `varchar`
|
|
62
|
-
without a length specified
|
|
63
|
-
|
|
64
|
-
## v0.6.0 - 2021-02-19
|
|
65
|
-
|
|
66
|
-
### Added
|
|
67
|
-
|
|
68
|
-
- added "debug" option for `--dump-ast` to print out tree using Rust's `Debug` formatter (#92)
|
|
69
|
-
- added new rule, "adding-foreign-key-constraint", to provide suggestions for safely adding foreign key constraints (#91)
|
|
70
|
-
|
|
71
|
-
### Changed
|
|
72
|
-
|
|
73
|
-
- updated "robust-stmts" suggestions with caveat about `IF NOT EXISTS` (#95)
|
|
74
|
-
- updated "constraint-missing-not-valid" to warn about adding a constraint as NOT VALID and then using "VALIDATE CONSTRAINT" in the same transaction (#97)
|
|
75
|
-
- updated "prefer-robust-stmts" with exception for using `DROP CONSTRAINT IF EXISTS` before `ADD CONSTRAINT` (#99)
|
|
76
|
-
|
|
77
|
-
### Fixed
|
|
78
|
-
|
|
79
|
-
- error reporting is more user friendly (#89, #90)
|
|
80
|
-
|
|
81
|
-
## v0.5.4 - 2021-01-08
|
|
82
|
-
|
|
83
|
-
### Fixed
|
|
84
|
-
|
|
85
|
-
- parsing of RangeVar with missing inh field
|
|
86
|
-
|
|
87
|
-
## v0.5.3 - 2021-01-04
|
|
88
|
-
|
|
89
|
-
### Fixed
|
|
90
|
-
|
|
91
|
-
- parsing of alter table with type cast
|
|
92
|
-
|
|
93
|
-
## v0.5.2 - 2020-10-26
|
|
94
|
-
|
|
95
|
-
### Fixed
|
|
96
|
-
|
|
97
|
-
- parsing of create table with primary key constraint on two fields
|
|
98
|
-
|
|
99
|
-
## v0.5.1 - 2020-10-07
|
|
100
|
-
|
|
101
|
-
### Fixed
|
|
102
|
-
|
|
103
|
-
- run `prefer-text-field` on alter table statments
|
|
104
|
-
|
|
105
|
-
## v0.5.0 - 2020-09-08
|
|
106
|
-
|
|
107
|
-
### Added
|
|
108
|
-
|
|
109
|
-
- new rule `adding-primary-key-field`
|
|
110
|
-
|
|
111
|
-
### Fixed
|
|
112
|
-
|
|
113
|
-
- parsing `->>` operator
|
|
114
|
-
|
|
115
|
-
## v0.4.1 - 2020-08-19
|
|
116
|
-
|
|
117
|
-
### Fixed
|
|
118
|
-
|
|
119
|
-
- parse function calls in alter table statements
|
|
120
|
-
|
|
121
|
-
## v0.4.0 - 2020-07-19
|
|
122
|
-
|
|
123
|
-
### Added
|
|
124
|
-
|
|
125
|
-
- new rule `ban-char-type`
|
|
126
|
-
|
|
127
|
-
## v0.3.0 - 2020-07-10
|
|
128
|
-
|
|
129
|
-
### Changed
|
|
130
|
-
|
|
131
|
-
- upload-to-github comment formatting to hopefully be more clear
|
|
132
|
-
- docs on crates.io for sub crates
|
|
133
|
-
|
|
134
|
-
## v0.2.3 - 2020-07-09
|
|
135
|
-
|
|
136
|
-
### Added
|
|
137
|
-
|
|
138
|
-
- new rule `prefer-robust-stmts`
|
|
139
|
-
|
|
140
|
-
## v0.2.2 - 2020-06-25
|
|
141
|
-
|
|
142
|
-
### Fixed
|
|
143
|
-
|
|
144
|
-
- upload-to-github commenting on PRs when no files provided (#30)
|
|
145
|
-
|
|
146
|
-
## v0.2.1 - 2020-06-25
|
|
147
|
-
|
|
148
|
-
### Changed
|
|
149
|
-
|
|
150
|
-
- remove `SQUAWK_GITHUB_BOT_NAME` env var for github upload, no longer needed (#27)
|
|
151
|
-
|
|
152
|
-
### Fixed
|
|
153
|
-
|
|
154
|
-
- false positive in unique constraint rule (#28)
|
|
155
|
-
|
|
156
|
-
## v0.2.0 - 2020-06-23
|
|
157
|
-
|
|
158
|
-
### Added
|
|
159
|
-
|
|
160
|
-
- logging, mainly around upload-to-github (#24)
|
|
161
|
-
- `--stdin-filepath` argument (#23)
|
|
162
|
-
- output a success message for CLI tty reporter (#22)
|
|
163
|
-
|
|
164
|
-
### Changed
|
|
165
|
-
|
|
166
|
-
- prefix env vars with SQUAWK\_ (#21)
|
|
167
|
-
|
|
168
|
-
### Fixed
|
|
169
|
-
|
|
170
|
-
- error level HTTP status codes not being errors (#20)
|
|
171
|
-
|
|
172
|
-
## v0.1.4 - 2020-06-21
|
|
173
|
-
|
|
174
|
-
### Added
|
|
175
|
-
|
|
176
|
-
- `upload-to-github` subcommand for outputing squawk results in a GitHub PR
|
|
177
|
-
comment.
|
|
178
|
-
- print help menu when no options provided
|
|
179
|
-
- automatically detect stdin instead of using the `-` path
|
|
180
|
-
|
|
181
|
-
### Fixed
|
|
182
|
-
|
|
183
|
-
- off by one error in slicing problem SQL for the tty reporter
|
|
184
|
-
|
|
185
|
-
## v0.1.3 - 2020-06-12
|
|
186
|
-
|
|
187
|
-
### Added
|
|
188
|
-
|
|
189
|
-
- documentation for rules
|
|
190
|
-
- release binaries
|
|
191
|
-
- CI
|
|
192
|
-
|
|
193
|
-
## v0.1.0 - 2020-06-05
|
|
194
|
-
|
|
195
|
-
### Added
|
|
196
|
-
|
|
197
|
-
- Initial release
|