Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yaml-lint bombs when an error is encountered #37

Open
TimPaulaskasDS opened this issue Feb 17, 2024 · 0 comments
Open

yaml-lint bombs when an error is encountered #37

TimPaulaskasDS opened this issue Feb 17, 2024 · 0 comments

Comments

@TimPaulaskasDS
Copy link

I have a YAML file in which I invalidate it by removing the dash (reducing the file for readability):

object: Account_Attribute__c
fieldPermissions:
  - field: infoAttr3__c
    editable: false
    readable: true
  - field: infoAttr4__c
    editable: false
    readable: true
  - field: infoAttr5__c
    editable: false
    readable: true
    field: infoAttr4__c
    editable: false
    readable: true

When I run yaml-lint on this file, it finds the duplicate key as expected:

 ERROR  duplicated mapping key (33:5)

 30 |   - field: infoAttr5__c
 31 |     editable: false
 32 |     readable: true
 33 |     field: infoAttr4__c
----------^
 34 |     editable: false
 35 |     readable: true

  
  30 |   - field: infoAttr5__c
  31 |     editable: false
  32 |     readable: true
  33 |     field: infoAttr4__c
  ----------^
  34 |     editable: false
  35 |     readable: true

However, it then shows stack trace of where the utility bombs:

  at generateError (node_modules/yaml-lint/node_modules/js-yaml/lib/loader.js:183:10)
  at throwError (node_modules/yaml-lint/node_modules/js-yaml/lib/loader.js:187:9)
  at storeMappingPair (node_modules/yaml-lint/node_modules/js-yaml/lib/loader.js:358:7)
  at readBlockMapping (node_modules/yaml-lint/node_modules/js-yaml/lib/loader.js:1173:9)
  at composeNode (node_modules/yaml-lint/node_modules/js-yaml/lib/loader.js:1441:12)
  at readBlockSequence (node_modules/yaml-lint/node_modules/js-yaml/lib/loader.js:1008:5)
  at composeNode (node_modules/yaml-lint/node_modules/js-yaml/lib/loader.js:1440:12)
  at readBlockMapping (node_modules/yaml-lint/node_modules/js-yaml/lib/loader.js:1164:11)
  at composeNode (node_modules/yaml-lint/node_modules/js-yaml/lib/loader.js:1441:12)
  at readDocument (node_modules/yaml-lint/node_modules/js-yaml/lib/loader.js:1625:3)
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

No branches or pull requests

1 participant