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

Guoxiong Li gli at openjdk.java.net
Wed Dec 1 18:05:15 UTC 2021


On Tue, 30 Nov 2021 11:42:56 GMT, Guoxiong Li <gli at openjdk.org> wrote:

> Hi all,
> 
> This patch adds the large binary file check to the jcheck.
> 
> The corresponding configuration is like the following code. Each key/value in the `[checks "binary"]` is a mapper. The `key` means the file pattern and the `value` means the limited file size. For example, `.*\.bin=200B` means the file which ends with `.bin` should not exceed 200 Bytes.
> 
> 
> [checks]
> error = binary
> 
> [checks "binary"]
> .*.bin=200B
> .*.o=1k
> 
> 
> The limited file size can use one of these several units:  b(Byte), kb(KiloByte), mb(MegaByte), gb(GigaByte). The units is case insensitive, which means the `Kb`, `kB` and `KB` are equals to `kb(KiloByte)`. If the unit is not provided, it defauts to `b(Byte)`. And these is no a unit called `bit`.
> 
> The corresponding test cases are added.
> 
> Best Regards,
> -- Guoxiong

> I found the original PR where this was added #159. It looks like they never got around to implementing handling in the PR visitor. I think it's good if you fix that.

I find that the field `JCheck#commitChecks` doesn't have the item `BinaryCheck`. So it seems that the `BinaryCheck` never run in both PR and git-jcheck command. I wiil fix it, too.

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

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


More information about the skara-dev mailing list