homeport / dyff

/ˈdʏf/ - diff tool for YAML files, and sometimes JSON
MIT License
1.28k stars 60 forks source link

Different boolean represenatations of the same value treated differently #334

Closed nresare closed 8 months ago

nresare commented 8 months ago

yaml treats a whole bunch of different tokens as a boolean value. For example both true and True has the semantic meaning of boolean true. However, when comparing two files with differing ways to encode the same boolean value.

Expected outcome: different encodings of the same boolean value should be treated the same

Actual outcome: only boolean values with identical textual representation are treated the same

See for example the following example:

$ cat left.yaml                    
---
key: True
$ cat right.yaml                   
---
key: true
$ dyff between left.yaml right.yaml
     _        __  __
   _| |_   _ / _|/ _|  between left.yaml
 / _' | | | | |_| |_       and right.yaml
| (_| | |_| |  _|  _|
 \__,_|\__, |_| |_|   returned one difference
        |___/

key
  ± value change
    - True
    + true