RFR: 1236: Add jcheck option to check for large binary files
Guoxiong Li
gli at openjdk.java.net
Wed Dec 1 18:41:28 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
About the errors and warnings, I re-read the related code.
Currently, the warning config is not the actual warnings in the PR. The PR bot doesn't distinguish them in the method `hiddenMessages` and `messages` of the class PullRequestCheckIssueVisitor. Both the errors and the warnings will be shown at the `### Errors` part of the PR first comment body and all of them will block the integration. Is it the intent of the PR bot?
> we could have a (generous) upper bound for binary sizes where jcheck makes it an error, and a much lower bound for which jcheck warns you that you perhaps should reconsider.
The goal is good. But we need to handle it carefully. Because the check config has the errors and warnings config, which I mentioned above.
If we add the check level, `error` and `warning`, in a concrete check, the understanding, usage and implementation seem more difficult to the user and the skara developer. Note what I mention above firstly: the current code about current errors and warnings config is not clear and is not equal to the git-jcheck before.
-------------
PR: https://git.openjdk.java.net/skara/pull/1247
More information about the skara-dev
mailing list