git-checks 4.4.0

Checks to run against a topic in git to enforce coding standards.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
# v4.4.0

## Changes

  * The `submodule_available`, `submodule_rewind`, and `submodule_watch` checks
    have learned to support topic-level checks.
  * Update to `hickory-resolver` 0.26 to avoid advisories.

# v4.3.2

## Changes

  * The `formatting` check now supports overriding the path to the formatter
    with the `formatter.{kind}.path` configuration value.
  * The `formatting` check now supports setting an environment variable for the
    formatter given by the `formatter.env_key` configuration value. The
    variable will be set to have a value of `check`.

# v4.3.1

## Changes

  * The `check_end_of_line` check now ignores files marked as binary via the
    `-diff` or `-text` attributes.

# v4.3.0

## Changes

  * Update to require `git-checks-config` 0.3.1 for the `config` feature to
    provide a newer `erased-serde` requirement.

# v4.2.3

## Updated checks

  * The `ValidName` check now performs DNS queries using
    `hickory-resolver` instead of calling out to the system `host` binary.
    A global DNS resolver using the system configuration is used.
  * The `InvalidPaths` check now rejects paths which have a restricted Windows
    pathname as a basename (e.g., `NUL.txt`).
  * MSRV bumped to 1.71 to support the `hickory-resolver` crate.

# v4.2.2

  * CI updates to publish from CI.

# v4.2.1

## Changes

  * Update to require `git-checks-config` 0.2.1 for the `config` feature to
    ensure proper static registration.
  * MSRV bumped to 1.62 (when using the `config` feature).

# v4.2.0

## New checks

  * The `FastForward` check is a branch check that checks whether a topic can
    be fast-forward merged into a target branch.
  * The `RejectBiDi` check is a content check that checks whether any Unicode
    bidirectional control characters are present in any added content. See
    [Trojan Codes][trojan-codes] for more details.

[trojan-codes]: https://www.trojansource.codes

## Changes

  * `CommitSubject` now detects variants of "draft" as a prefix to commit
    subjects as work-in-progress commits.
  * `CommitSubject` now detects `amend!` rebase commands.
  * `CommitSubject` can now detect suggestion application commit messages from
    GitLab and GitHub.
  * `RejectBinaries` now detects PE (Windows) binaries.
  * `inventory` 0.2 is now used. Consumers will need to match with it to see
    the instances. There is now a re-export of `inventory` when the `config`
    feature is used.
  * MSRV bumped to 1.47.

# v4.1.0

## Changes

  * `ValidName::whitelisted_domains` is now `trust_domains`. Backwards
    compatibility is provided.

# v4.0.3

## Changes

  * `ValidName::ValidNameFullNamePolicy` now implements `PartialEq` and `Eq`
  * The `SubmoduleWatch` check now warns if an unconfigured submodule is
    modified.

## Fixes

  * The `SubmoduleWatch` check now properly detects submodules which transform
    from or into non-submodules in the same commit.

# v4.0.2

  * Improve logging and collection when a formatter fails in the `Formatting`
    check.

# v4.0.1

  * Update private dependencies.

# v4.0.0

## Breaking changes

  * The `RejectConflictPaths` is now only constructable via its `new`
    constructor method.
  * No more `error-chain`.
  * `ToString` has been replaced with `Into<String>` in APIs. This shouldn't
    affect any code except those using array literals.
    `takes_to_string_iter(&["literal"])` becomes
    `takes_into_string(["literal"].iter().cloned())`.
  * All checks have been converted over to a builder pattern. This carries a
    big API change, but it has the following benefits:
    - Configurations on checks are documented in just one place now (rather
      than the field and associated method).
    - Names appear in configuration calls. For example, instead of an opaque
      `ThirdParty("blah", "blah", "blah", "blah")` call, each now has a name
      associated with the call on the builder.
    - Consistency. All checks now support the builder pattern, but offer an
      `impl Default` if available.
  * There is now a `config` feature which registers deserialization for all
    checks in the crate through the mechanisms provided by `inventory` and
    `git-checks-config`.

## New checks

  * The `BadCommit` check is a single-commit variant of `BadCommits` which
    allows for a reason to be given for the rejection.

## Changes

  * The core functionality has been split into the `git-checks-core` crate.
  * Various checks have gained `Clone` or `Copy` implementations as available.

## Fixes

  * The `RejectConflictPaths` check's `Default` implementation now matches its
    `::new()` method.

## Updated checks

  * The `Changelog` check now supports looking for a set of files for entries.
  * The `CheckExecutablePermissions` check now detects binaries using the same
    logic as the `RejectBinaries` check.
  * The `CheckExecutablePermissions` check now detects AR binaries (used for
    static libraries on ELF platforms and import libraries on Windows).
  * The `CheckExecutablePermissions` now ignore LFS-tracked files.
  * The `Formatting` check now passes the value of the formatting attribute to
    the formatter if set. Previously, a formatting attribute with a value was
    ignored.
  * The `RejectBinaries` check now detects AR binaries.
  * The `RejectConflictPaths` check can now be configured to reject any
    conflict resolution path regardless whether the base file exists or not.
  * The `Changelog` now requires that changelog file contents change. Changing
    the mode on a changelog file is no longer sufficient.
  * The `InvalidPaths` check now supports enforcing Windows filename rules.
  * The `CheckSize` check now has a `Default` implementation. It is 1 MiB by
    default.

# v3.9.1

## Updated checks

  * The `BadCommits` check now has a `TopicCheck` implementation which is
    equivalent, but more efficient, than its `Check` implementation.

# v3.9.0

## Updated checks

  * The `InvalidPaths` check now supports allowing ` ` in paths (ASCII 0x20).

# v3.8.0

## Updated checks

  * The `CommitSubject` check now supports checking for prefixes tolerated
    according to a regular expression.

# v3.7.0

## Updated checks

  * The `CommitSubject` check now supports checking for allowed and disallowed
    prefixes. This does cause the check to no longer `impl Copy`, a technically
    breaking change, but is not deemed worthy enough to require a major version
    bump.

# v3.6.0

## Changes

  * Per-commit check information is now returned in a topological order. That
    is, when iterating using `TopicCheckResult::commit_results`, no commit will
    be listed if its parent hasn't already been listed unless it is already
    part of the target branch.

## Fixes

  * The `SubmoduleRewind` check no longer errors when *updating* a submodule
    reference we can't find.

## New checks

  * The `RejectBinaries` checks that ELF and Mach-O binaries are not added to
    the repository.

# v3.5.3

## Fixes

  * No longer creates git work areas when there are no checks.

# v3.5.2

## Fixes

  * Now works with rust 1.29 which stabilized an `Iterator::flatten`
    function that conflicts with `Itertools::flatten`.

# v3.5.1

## Fixes

  * Now works with `arrayvec` (a dependency of `rayon-1.0.0`) which causes
    coersions to fail. See https://github.com/rust-lang/rust/issues/48406.

# v3.5.0

## Updated checks

  * `ValidName` may now be given domains to assume are valid.

# v3.4.0

## Updated checks

  * `ValidName` now caches its DNS query results for domain names. It is no
    longer `Copy`, but it is still `Clone` (the cache is cleared when cloned).
  * `Formatting` now cleans up child formatting processes which timed out.

# v3.3.0

  * The `Content` trait now can prepare a new workarea for a context using the
    `workarea` method.
  * `CheckGitContext` has deprecated `checkout` and `cd_to_worktree` methods
    as unsafe. They should have been `&mut self` methods.
  * `CheckGitContext` now has `workarea` and `workarea_mut` methods to get the
    underlying `GitWorkArea`.

# v3.2.1

## Updated checks

  * `ThirdParty` now refers to a "utility" rather than a "script" in its error
    messages.

# v3.2.0

  * Exposed a `FileName::new` method so that the filename parsing may be used
    externally.

## Updated checks

  * `Formatting` now supports naming the check differently than the attribute
    used to reformat. This may be used to refer to a formatter using a more
    specific name (such as with a version number).

## New checks

  * The `Changelog` checks that changes modify paths related to changelog
    entries. It supports the single file and directory of entries styles of
    changelog management.

# v3.1.1

  * Submodules which have different names and paths are now properly handled.

## Updated checks

  * `SubmoduleWatch` no longer messages about added modules if the module has
    been configured. This allows configuring the module to resolve the
    messages.

# v3.1.0

## New checks

  * The `LfsPointer` check verifies that paths with the `filter=lfs` attribute
    are valid according to the LFS specification.

# v3.0.0

  * Updated to `git-workarea-3.0.0`.

# v2.3.1

  * `Topic` has been fixed to give a diff against its merge base with the
    target branch rather than the current `HEAD` of the target branch.

# v2.3.0

  * `Commit::file_patch` may be used to get the patch contents of a path.
  * Added the `Topic` structure which represents an entire topic.
  * Both `Commit` and `Topic` implement the new `Content` check for use by
    checks which only care about content rather than Git-level metadata (such
    as topology and commit messages).
  * Added the `TopicCheck` trait for checking entire topics as a whole rather
    than individual commits.
  * Added the `ContentCheck` trait for checks which only care about `Content`.
  * The `impl_prelude` now contains two functions, `commit_prefix` and
    `commit_prefix_str` which create a `String` which mentions the commit for
    commits with an optional custom string.

## Updated checks

  * The following checks have been converted to `ContentChecks`:
    - `CheckEndOfLine`
    - `CheckExecutablePermissions`
    - `CheckSize`
    - `CheckWhitespace`
    - `Formatting`
    - `InvalidPaths`
    - `InvalidUtf8`
    - `RejectSymlinks`
    - `RestrictedPath`
  * `BadCommits` and `CheckExecutablePermissions` now support construction
    with iterators.

# v2.2.1

  * Private dependencies bumped.

# v2.2.0

  * Checks may now add a message with a configured severity level rather than
    calling different methods.

## Updated checks

  * `Formatting` now supports a timeout on formatting operations.

# v2.1.1

  * Dependency specifications for `git-workarea` and `error-chain` have been
    relaxed.

# v2.1.0

## Updated checks

  * `Formatting` now supports adding a message about how the formatting can be
    fixed.

# v2.0.0

  * Updated to `git-workarea-2.0.0`.
  * Checks may now mark that messages are temporary.
  * Checks must now be `Send` in order to support being run in parallel via
    `rayon`.
  * `CheckGitContext::cd_to_work_tree` may be used to run a command within the
    internal workarea.
  * `CheckGitContext::check_attr` now accepts arguments via `AsRef`.
  * `Commit::changed_files` may be used to get a list of changed files
    (symlinks and submodules are skipped).
  * `GitCheckConfiguration` now implements `Debug`.
  * There is now an `impl_prelude` module which contains all of the imports
    necessary to write checks.
  * `Commit::sha1_short` has been removed. Checks now always use the full
    commit hash in their messages.
  * Commit messages no longer have an extra newline at their end.

## Fixed checks

  * `CheckEndOfLine` no longer errors out when adding the missing newline at
    the end of a file.
  * `CheckSize` no longer tries to check submodule sizes (which are undefined
    in Git).
  * `SubmoduleRewind` now checks that a commit exists before checking for
    ancestry on a branch.
  * `ValidName` now collapses errors if the commiter and author are the same
    identity.
  * `ReleaseBranch` now checks that all merge bases are valid for the release
    branch.

## Updated checks

  * The `ValidName` check now supports different full name policies:
    - `Required` (the old behavior)
    - `Preferred` (just warns)
    - `Optional` (no diagnostics)
  * `RestrictedPath` can now warn about paths rather than only erroring.

## New checks

  * The `Formatting` check for checking formatting of files has been added.
    See the documentation for the requirements.

# v1.0.0

  * Initial stable release.