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

Add a check for merge conflict markers in YAML files #69

Closed
joelparsons opened this issue Mar 29, 2014 · 3 comments
Closed

Add a check for merge conflict markers in YAML files #69

joelparsons opened this issue Mar 29, 2014 · 3 comments

Comments

@joelparsons
Copy link
Contributor

You get a non-trivial to figure error report:

Psych::SyntaxError - (<unknown>): could not find expected ':' while scanning a simple key at line 14 column 1
/Users/orta/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych.rb:205:in `parse'
/Users/orta/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
/Users/orta/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych.rb:153:in `parse'
/Users/orta/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych.rb:129:in `load'
/Users/orta/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-core-0.29.0/lib/cocoapods-core/lockfile.rb:43:in `from_file'
/Users/orta/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.29.0/lib/cocoapods/config.rb:208:in `lockfile'
/Users/orta/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.29.0/lib/cocoapods/command/project.rb:36:in `run_install_with_update'
/Users/orta/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.29.0/lib/cocoapods/command/project.rb:68:in `run'
/Users/orta/.rvm/gems/ruby-2.0.0-p247/gems/claide-0.4.0/lib/claide/command.rb:213:in `run'
/Users/orta/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.29.0/lib/cocoapods/command.rb:51:in `run'
/Users/orta/.rvm/gems/ruby-2.0.0-p247/gems/cocoapods-0.29.0/bin/pod:24:in `<top (required)>'
/Users/orta/.rvm/gems/ruby-2.0.0-p247/bin/pod:23:in `load'
/Users/orta/.rvm/gems/ruby-2.0.0-p247/bin/pod:23:in `<main>'
/Users/orta/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `eval'
/Users/orta/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `<main>'

From:

PODS:
  - Kiwi (2.2)
  - ObjectiveSugar (1.1.1)

DEPENDENCIES:
  - Kiwi
  - ObjectiveSugar (from `../`)

EXTERNAL SOURCES:
  ObjectiveSugar:
    :path: ../

SPEC CHECKSUMS:
<<<<<<< HEAD
  Kiwi: 05f988748c5136c6daed8dab3563eca929399a72
  ObjectiveSugar: 7377622e35ec89ce893b05dd0af4bede211b01a4
=======
  Kiwi: db174bba4ee8068b15d7122f1b22fb64b7c1d378
  ObjectiveSugar: 27c680bb74f0b0415e9e743d5d61d77bc3292d3f
>>>>>>> b65623cbf5e105acbc3e2dec48f8024fa82003ce

COCOAPODS: 0.29.0

Where an error message would be super useful for a lot of people.

This is opened as a duplicate of CocoaPods/CocoaPods#1847 as the issue would be better fixed here in core.
//cc @orta

@fabiopelosin
Copy link
Member

To fix this issue:

  1. The YAMLConverter should be renamed to YAMLHelper and should introduce a load method.
  2. This method should replace all the YAML.load invocations.
  3. The implementation should call YAML.load.
  4. Psych::SyntaxError should be catcher and the file checked for merge issues by looking for the string <<<<<<< HEAD in, this case a new exception should thrown presenting a more informative message.

@fabiopelosin
Copy link
Member

Ideally similar logic should be performed for JSON.

@alloy
Copy link
Member

alloy commented Apr 3, 2014

👍

luisdelarosa added a commit to luisdelarosa/Core that referenced this issue Apr 5, 2014
luisdelarosa added a commit to luisdelarosa/Core that referenced this issue Apr 5, 2014
luisdelarosa added a commit to luisdelarosa/Core that referenced this issue Apr 5, 2014
Ashton-W pushed a commit to Ashton-W/Core that referenced this issue Nov 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants