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

Comments

Projects
None yet
3 participants
@joelparsons
Contributor

joelparsons commented Mar 29, 2014

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

This comment has been minimized.

Show comment
Hide comment
@fabiopelosin

fabiopelosin Apr 2, 2014

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.
Member

fabiopelosin commented Apr 2, 2014

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

This comment has been minimized.

Show comment
Hide comment
@fabiopelosin

fabiopelosin Apr 3, 2014

Member

Ideally similar logic should be performed for JSON.

Member

fabiopelosin commented Apr 3, 2014

Ideally similar logic should be performed for JSON.

@alloy

This comment has been minimized.

Show comment
Hide comment
@alloy

alloy Apr 3, 2014

Member

👍

Member

alloy commented Apr 3, 2014

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment