Skip to content

py-strictcli@v0.45.0

Choose a tag to compare

@smm-h smm-h released this 01 Oct 18:02
· 127 commits to main since this release

Integer values accept only plain decimal digits with an optional leading minus sign: a plus sign and leading zeros are refused.

Context

The owner ruled one integer form for all three implementations, wherever the framework parses an integer from text (the command line, an environment binding, and config set): 30 and -5 parse, while +30, 030, whitespace, digit separators, and every other form are refused with the existing expected-integer error. Before, Go and TypeScript accepted +30 and 030, and Python also accepted non-ASCII digits. This is breaking, which in 0.x is a minor.

Breaking

  • [strictcli] Integer values refuse a plus sign, leading zeros, and non-ASCII digits. An int flag, positional argument, environment value, or config set value now accepts only plain ASCII decimal digits with an optional leading minus sign: 30 and -5 parse, while +30, 030, -030, and digits such as ٣٠ are refused with expected integer, got '<value>' (naming the variable for an environment value). Write 30 instead.