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

Added support for having coding standards in the root package #25

Merged
merged 1 commit into from May 10, 2017

Conversation

frenck
Copy link
Contributor

@frenck frenck commented May 9, 2017

Proposed Changes

This change adds support for having PHP_CodeSniffer standards in the root package.

Related Issues

Implements: #20 Check the root package for sniffs to install

@frenck frenck added this to the v0.4.0 milestone May 9, 2017
@frenck frenck self-assigned this May 9, 2017
@frenck frenck requested a review from Potherca May 9, 2017 16:30
@frenck
Copy link
Contributor Author

frenck commented May 9, 2017

Travis tests fails, enabled by @Potherca, but not configured it yet.
Therefore the failed Travis builds can be ignored for now.


$searchPaths = [getcwd()];
Copy link
Member

@Potherca Potherca May 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For completeness sake: although usually using getcwd (and consorts) is discouraged, this is the "Composer Way" of doing things.

@frenck
Copy link
Contributor Author

frenck commented May 9, 2017

Just thought of an edge case that might cause troubles with this solution:

  • This plugin is installed globally
  • Current working directory is a repository containing a coding standard
  • Running a composer global install/update command

This might cause the installation of the local coding standard into the global scope.

Will check on this tomorrow.

@frenck
Copy link
Contributor Author

frenck commented May 10, 2017

Checked my above concerns and concluded this won't be an issue since the Composer GlobalCommand will change the working directory before actually running Composer (again).

See: https://github.com/composer/composer/blob/9e7d1a4f9ed34466a05ac1356e97a98686f7da67/src/Composer/Command/GlobalCommand.php#L77

@frenck frenck merged commit 4bb05bc into master May 10, 2017
@frenck frenck deleted the feature/support-coding-standards-in-root-package branch May 10, 2017 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants