Skip to content

Conversation

@G4G4N
Copy link

@G4G4N G4G4N commented Sep 30, 2025

… (#157)

Summary

Fixes #157 by validating indent_count in SqlToStringFormat so negative values can’t create invalid state or odd formatting behavior (e.g., in separator() which uses range(self.indent_count + cnt)).

Changes

  • pylegend/core/database/sql_to_string/config.py
  • Validate indent_count in init and raise a clear ValueError for negative inputs.

Rationale

  • Fail fast at object creation.
  • Prevents subtle bugs from negative indentation while keeping all valid usages untouched.

Backward Compatibility

  • No behavior changes for non-negative values.
  • Calling code that previously passed negatives will now raise ValueError (intended safeguard).

Test Plan

  • Valid: 0, 1, 5, 10 → object constructs and methods behave as before.
  • Invalid: -1, -10 → ValueError with helpful message.

All tests pass locally.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 30, 2025

CLA Signed

  • ✅login: G4G4N / name: G4G4N / (7271a3d)

The committers listed above are authorized under a signed CLA.

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.

Missing Input Validation for indent_count in SqlToStringFormat

1 participant