WordPress / WordPress-Coding-Standards

PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions
MIT License
2.56k stars 487 forks source link

creating a project #2111

Closed ghost closed 1 year ago

ghost commented 1 year ago

by crating a project using composer create-project wp-coding-standards/wpcs --no-dev gives the following issue

benlumia007@aesculapius:~/reviews$ composer create-project wp-coding-standards/wpcs --no-dev
Creating a "wp-coding-standards/wpcs" project at "./wpcs"
Installing wp-coding-standards/wpcs (2.3.0)
  - Installing wp-coding-standards/wpcs (2.3.0): Extracting archive
Created project in /home/benlumia007/reviews/wpcs
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - dealerdirect/phpcodesniffer-composer-installer[v0.5.0, ..., v0.6.2] require composer-plugin-api ^1.0 -> found composer-plugin-api[2.3.0] but it does not match the constraint.
    - Root composer.json requires dealerdirect/phpcodesniffer-composer-installer ^0.5 || ^0.6 -> satisfiable by dealerdirect/phpcodesniffer-composer-installer[v0.5.0, v0.6.0, v0.6.1, v0.6.2].

need some feedback

dingo-d commented 1 year ago

Never used this command tbh, I usually add wpcs as a dependency in composer using the composer require command 🤷‍♂️

ghost commented 1 year ago

@dingo-d what's up, it's been a while. yeah, i only tried that way because of another group recommend it their project. the require and gobal require seems to work fine. so i don't really understand the create project would be an issue.

jrfnl commented 1 year ago

@benlumia007 I know the install instructions in the readme need to be updated (already got the update ready to pull before 3.0.0 gets released), create-project should normally only be used by people who want to contribute to a project.

The problem you are running into has to do with dev dependencies which are outdated on the last tagged release. IIRC installing/creating the project with --no-dev should hopefully resolve that.

ghost commented 1 year ago

@jrfnl I appreciated your quick response Juliette. Looking forward to the 3.0 release.

ghost commented 1 year ago

should we leave this open so other users can find this ticket or should we just close it.

jrfnl commented 1 year ago

I think we can just close it. IIRC there is actually another ticket already open about improving the installation instructions (#1901), so this can be closed as a duplicate.

ghost commented 1 year ago

closing ticket as duplicate!