Skip to content

no support for alternative integer formats #966

Description

@erwindon

Describe the bug
The salt command-line supports a few more integer notations. And users may assume that one or more notations are also supported.
Additionally, these integer notations are all subject to overflow and/or accidental rounding as shown by @rawsun007 in #964.

To Reproduce
This is supported by salt:

Decimal | 123 | 123
Hexadecimal | 0x7b | 123
Binary | 0b1111011 | 123
(Octal) | 0173 | 123 | but no longer in yaml 1.2+ specs, not in salt
Sexagesimal | 2:0:0 | 7200 | but no longer in yaml 1.2+ specs, still in salt

** Suggestion
warn user for the use of these formats while still typing.
e.g.:

  • note: 0x7b will be treated as hexadecimal integer
  • note: 0x7b7b7b7b7b7b7b7b7b is too large for a hexadecimal integer, use quotes when it should be a string
  • etc.

presentation maybe as tooltip on a warning icon at the end of the row. this allow multiple warnings. it is also acceptable to show transient errors such as unclosed-strings while you are still typing it.

Expected behaviour
match or document

Additional context
https://ruuda.nl/2023/the-yaml-document-from-hell

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions