Skip to content

fix(engine): update yaml parsing to support a wider variety of integer representations#7875

Merged
cx-eduardo-semanas merged 5 commits into
masterfrom
ast-120100
Nov 25, 2025
Merged

fix(engine): update yaml parsing to support a wider variety of integer representations#7875
cx-eduardo-semanas merged 5 commits into
masterfrom
ast-120100

Conversation

@cx-eduardo-semanas

@cx-eduardo-semanas cx-eduardo-semanas commented Nov 24, 2025

Copy link
Copy Markdown
Contributor

Reason for Proposed Changes

  • Our current YAML support only successfully parses integer values when in decimal representation.

Proposed Changes

  • Change the string-to-int conversion method from the "strconv.Atoi" to strconv.ParseInt, which supports a wider variety of integer representations, such as:
    • Decimal ("24")
    • Binary ("0b11000")
    • Octal (both the current/modern YAML syntax "0o30" and the older/currently used by C syntax "030")
    • Hexadecimal ("0x18")
    • Exponential("24e0")
    • Snake_Case ("7_000_000_000")
  • Added a corresponding Unit Test covering the different representations

I submit this contribution under the Apache-2.0 license.

…der to support a larger variety of integer representations (i.e.: binary, octal, hexadecimal...)
@cx-eduardo-semanas cx-eduardo-semanas requested a review from a team as a code owner November 24, 2025 16:26
@github-actions

Copy link
Copy Markdown
Contributor

kics-logo

KICS version: v2.1.13

Category Results
CRITICAL CRITICAL 0
HIGH HIGH 0
MEDIUM MEDIUM 0
LOW LOW 0
INFO INFO 0
TRACE TRACE 0
TOTAL TOTAL 0
Metric Values
Files scanned placeholder 1
Files parsed placeholder 1
Files failed to scan placeholder 0
Total executed queries placeholder 47
Queries failed to execute placeholder 0
Execution time placeholder 0

@cx-artur-ribeiro cx-artur-ribeiro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cx-eduardo-semanas cx-eduardo-semanas merged commit 0ece06b into master Nov 25, 2025
26 checks passed
@cx-eduardo-semanas cx-eduardo-semanas deleted the ast-120100 branch November 25, 2025 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants