twosixlabs / armory

ARMORY Adversarial Robustness Evaluation Test Bed
MIT License
174 stars 67 forks source link

[BUG]: python -m json.tool: error: unrecognized arguments: --indent=4 #1870

Open ppark-twosixtech opened 1 year ago

ppark-twosixtech commented 1 year ago

Description of the bug

Executing a git commit leads to the following error for a pre-commit hook:

📄 Executing 'json.tool' formatter...
usage: python -m json.tool [-h] [--sort-keys] [--json-lines]
                           [infile] [outfile]
python -m json.tool: error: unrecognized arguments: --indent=4

--indent was introduced in Python 3.10, so this command will not work for lower Python versions (3.8.10 in my case). For awareness, the pre-commit hook change was introduced with PR #1708.

Recommend developers either remove --indent=4 from the command or update Python to 3.10 or higher.

Steps To Reproduce

Execute git commit to run pre-commit hook

Additional Information

No response