yara-x icon indicating copy to clipboard operation
yara-x copied to clipboard

feat: adds --test flag in yr fmt

Open shellcromancer opened this issue 2 years ago • 2 comments

Adds -t/--test flag in yr fmt which returns an error code if formatting made changes on the file.

This feature exists in a few other language formatting tools (jsonnet, terraform, gofmt) which is useful as part of stylistic CI/CD checks

shellcromancer avatar Jan 13 '24 03:01 shellcromancer

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Jan 13 '24 03:01 google-cla[bot]

Signed the Google CLA, should be ready for a maintainer review, thanks! 👍

shellcromancer avatar Jan 17 '24 03:01 shellcromancer

In https://github.com/VirusTotal/yara-x/commit/4b0889938df1feff849e6c9cdd4d84ab59eeec86 I made multiple changes to the fmt command. Now it always exits with error code 0 if files didn't change or 1 if otherwise.

plusvic avatar Sep 09 '24 14:09 plusvic

Makes sense, thanks for including the feature in your changes. 👍

shellcromancer avatar Sep 09 '24 14:09 shellcromancer