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

.inc files trigger merge conflicts #2204

Closed
BonBonSlick opened this issue Oct 24, 2018 · 3 comments
Closed

.inc files trigger merge conflicts #2204

BonBonSlick opened this issue Oct 24, 2018 · 3 comments

Comments

@BonBonSlick
Copy link

BonBonSlick commented Oct 24, 2018

I was confused when got merge conflicts during rebase, but version control tab was empty, after manual check, figured out that there are vendor files with conflicts!

 grep -H -r "<<<<<<< HEAD" /var/www/site/site/

/var/www/site/site/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowLongArraySyntaxUnitTest.2.inc:<<<<<<< HEAD

/var/www/site/oppassiteand/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/DisallowLongArraySyntaxUnitTest.2.inc.fixed:<<<<<<< HEAD

/var/www/site/site/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/HeredocUnitTest.inc:<<<<<<< HEAD

In this files I see

<?php
$var = array();

// The following function has a simulated git conflict for testing.
// This is not a merge conflict - it is a valid test case to test handling of arrays without associated closer.
// Please do not remove.
function test()
    {
        $arr = array(
            'a' => 'a',
<<<<<<< HEAD
            'b' => 'b'
=======
            'c' => 'c'
>>>>>>> master
        );
    }

This does not allow us to do rebase. Changing it says that it is vendor package, changes will be overwritten. Package must not generate such files. Why it generated them?

@jrfnl
Copy link
Contributor

jrfnl commented Oct 24, 2018

  1. Why are you scanning/committing the content of the vendor directory ?
  2. These are test files to verify that various sniffs work correctly. The planning is for those to no longer be shipped with PHPCS by default as of version 4.0. See Remove tests from the composer package #1908

@BonBonSlick
Copy link
Author

BonBonSlick commented Oct 24, 2018

It is ignored by git.
/vendor/
and does not tracked.
I do not scanning anything, just running rebase with local branch and develop.
Manual see conflicts, because VersionControll was empty for PhPStorm 2018

@gsherwood
Copy link
Member

If you can't have PHPCS in your vendor folder because of this, maybe install it globally.

I'm going to close this as the conflicts must stay as they are part of tests, and the test will be removed in version 4 so this is already on the roadmap.

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

3 participants