Preserve case when parsing boolean like strings - #1634
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces syaml_bool to preserve the original string representation of booleans (such as 'TRUE' or 'False') when parsing and dumping YAML files, and updates the validator, expander, and variant modules to support it. The review feedback highlights a duplicate and buggy definition of represent_bool in OrderedLineDumper inside spack_yaml.py, and recommends replacing fragile string-based type checks (type(...).__name__ == "syaml_bool") in variants.py with robust isinstance checks.
Ramble Performance Test MetricsResults produced with commit: 5b99a06
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1634 +/- ##
========================================
Coverage 93.35% 93.35%
========================================
Files 365 365
Lines 35552 35571 +19
========================================
+ Hits 33188 33207 +19
Misses 2364 2364 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I'm generally OK with this and would like to get it merged. Do you plan to address the gemini comments? |
This commit updates the YAML parser so that input strings (for example, TRUE) retain their case, and are not converted into Python equivalents (i.e. True).
cfce34a to
74a8d2b
Compare
74a8d2b to
5b99a06
Compare
|
@rfbgo Comments should be addressed now. |
This merge adds a test, and fixes an issue where input strings (for example in env-vars) that can be converted into a boolean (i.e. TRUE) are converted into Python syntax for the booleans (i.e. True).
They now retain their original input case.