RFR: 1236: Add jcheck option to check for large binary files

Guoxiong Li gli at openjdk.java.net
Tue Nov 30 13:59:51 UTC 2021


On Tue, 30 Nov 2021 13:09:17 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

> I would rather see two separate parameters, a size and a list of files (with regex support, like we have for the whitespace check), so that we don't have to repeat the size. We don't need the flexibility to set the limit per-extension.

This binary file check is not much like the whitespace check. The different file types have different basic sizes. The image type may be 500B-4kB and the audio type may be 2kB-32kB. So we can set the config as the following:


[checks]
error = binary

[checks "binary"]
; the image type
.*.jpg|.*.png|.*.gif=5k

; the audio type
.*.wav|.*.mp3=40k


If we have the only limited size as 40k, it is too large for the image type. If we have the only limited size as 5k, it is too small for the audio type.

The demo above only consider two file types.  The other types, such as video type and so on, have the same issue we need to solve. So I think the configuration in this patch is more flexible than the whitespache check and can meet the requirements of our repositories.

-------------

PR: https://git.openjdk.java.net/skara/pull/1247


More information about the skara-dev mailing list