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

Support existing standards packages with subfolders #6

Merged
merged 4 commits into from
Feb 5, 2017

Conversation

christopher-hopper
Copy link
Contributor

Proposed Changes

  • Search package sub-folders to a limited depth (< 4), to find PHP CodeSniffer standards
  • Only add installed paths where a ruleset.xml exists in a standards sub-folder
  • Update README to reflect requirements change
  • Fix some spelling mistakes in comments

Motivation

I want to use your excellent installer plugin with the Drupal PHP CodeSniffer standards. Their package uses a subfolder, one deeper than the repository root, which they're unable to change. I am sure there are other examples where Standards may be one or two folders deeper than the current installer allows.

Notify

@christopher-hopper
Copy link
Contributor Author

If this change or similar is accepted, allowing a slightly deeper directory tree for standards, I'll be submitting a change to the Drupal Coder module, asking them to adjust the package type from "library" to "phpcodesniffer-standard".

See this fork

@Potherca
Copy link
Member

Potherca commented Feb 3, 2017

Changes look good, motivation is solid.
Very nice!

@christopher-hopper
Copy link
Contributor Author

I've been using my changes with the following composer.json and it seems to be working very well:

{
  "type": "metapackage",
  "minimum-stability": "dev",
  "prefer-stable": true,
  "config": {
    "preferred-install": "dist",
    "discard-changes": true
  },
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/christopher-hopper/coder"
    },
    {
      "type": "vcs",
      "url": "https://github.com/christopher-hopper/phpcodesniffer-composer-installer"
    }
  ],
  "require": {
    "php": ">=5.4",
    "mouf/nodejs-installer": "~1.0"
  },
  "require-dev": {
    "dealerdirect/phpcodesniffer-composer-installer": "dev-master",
    "frenck/php-compatibility": "*",
    "drupal/coder": "dev-8.x-2.x"
  }
}

Once merged I will be submitting a pull request to the drupal/coder project so their Composer package type is changed to "type" : "phpcodesniffer-standard"

Copy link
Contributor

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Awesome job!

@frenck frenck merged commit 08b7448 into PHPCSStandards:master Feb 5, 2017
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.

3 participants