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

Preferred upgrade path when installed using create-project? #481

Closed
jjeaton opened this issue Nov 2, 2015 · 10 comments · Fixed by #2367
Closed

Preferred upgrade path when installed using create-project? #481

jjeaton opened this issue Nov 2, 2015 · 10 comments · Fixed by #2367

Comments

@jjeaton
Copy link

jjeaton commented Nov 2, 2015

I can't seem to find any information on how to upgrade to the latest release of wpcs when installed using this:

composer create-project wp-coding-standards/wpcs:dev-master --no-dev

Running composer update only updates the dependencies. Is there a recommended way to keep this up to date with composer, or do I need to delete the directory and run composer create-project wp-coding-standards/wpcs:dev-master --no-dev again?

@samwilson
Copy link
Contributor

Not a direct answer to your problem, but I always install this with composer global require wp-coding-standards/wpcs:dev-master because it makes updating so simple (just a matter of running composer global update, which I do regularly anyway).

@jjeaton
Copy link
Author

jjeaton commented Feb 2, 2016

@samwilson yeah, I originally had it that way but changed the to install instructions in the README. I'm thinking the README should maybe suggest installing globally with composer over create-project as not being able to update it is an issue.

@samwilson
Copy link
Contributor

@jjeaton Yeah I reckon global require is easier. :)

@jjeaton
Copy link
Author

jjeaton commented Sep 21, 2016

Any chance of updating the README or providing recommended install instructions that include the ability to upgrade to the latest version?

@JDGrimes
Copy link
Contributor

It looks like @Rarst is the one that originally suggested using composer create-project via a887ff6. I think he is a Composer guru, so maybe he could enlighten us as to why he originally suggested that and if there is a way to update from there.

@Rarst
Copy link
Contributor

Rarst commented Sep 21, 2016

If you chose to keep .git directory during install then update to latest master would be git pull && composer update (hm, we don't commit lock, maybe we should). Otherwise you would have to delete the dir and make a fresh one.

Personally I have a local project for tools (never got on global install bandwagon).

Does composer global update actually update dev-master versions? It tends not to for normal non–global installs.

@danielbachhuber
Copy link
Member

+1 to composer global require:

export PATH="$HOME/.composer/vendor/bin:$PATH"
composer global require wp-coding-standards/wpcs
phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs

I ended up on this issue because I was curious why composer create-project was the recommended behavior.

@grappler
Copy link
Member

PHPCS also recommends composer global require "squizlabs/php_codesniffer=*" https://github.com/squizlabs/PHP_CodeSniffer

I think that is better than composer create-project. Or the WPCS would be added to a project locally.

@Rarst
Copy link
Contributor

Rarst commented Dec 30, 2016

I think our defaults are reasonable and we create no roadblocks for other configurations for those who want it, I would say good enough for now. :)

If one knows difference between creating project and global install then they can pick which suits their needs more just fine.

@jjeaton
Copy link
Author

jjeaton commented Jan 3, 2017

To me, updating the README to outline the options (plus how to upgrade) would be useful.

Even if it's to say, "if you use our recommended install method, you have to delete it and re-install with create-project to update". I agree that composer global require seems like a better option, at least for keeping up to date with wpcs (if you aren't contributing directly to its development).

@jrfnl jrfnl added this to the 3.0.0 milestone Apr 1, 2020
@jrfnl jrfnl self-assigned this Apr 11, 2020
jrfnl added a commit that referenced this issue Aug 20, 2023
This commit updates the README guide to be in line with WordPressCS 3.0.0.

This commit:
* Removes the "Last commit to stable" and "Nr of contributors" badges.
* Updates the "Tested on PHP..." badges.
* Updates the table of contents to match the new content of the file.
* Removes the "Project history" section (has been moved to the wiki).
* Makes the pre-requisites for the package more explicit and puts them in a separate section.
* Updates the installation instructions and adds update instructions.
    - Removes the instructions related to stand-alone installs and using `composer create-project`.
    - The new installation instructions take the changes in Composer 2.2 (permission required for plugins to run) into account.
    - The new installation instructions include a link to the end user/ruleset maintainer upgrade guide for WPCS 3.0.0 as the initial upgrade may need extra work.
* Updates references to the Composer PHPCS plugin to make sure these reference the new name and link to the correct GH repo (as the repo has moved).
* Removes the reference to the VIP ruleset which was removed in WPCS 2.0.0 from the "Rulesets" section.
* Adds links to the "customizable properties" section for where to find customizable properties for PHPCS native sniffs and sniffs from PHPCSExtra.
* Adds the `VariableAnalysis` standard and the `VIP Coding Standards` to the list of optional additional rulesets to use.
* Updates the command and output for the example run.
* Removes the links to IDE related tutorials in favour of a link to the wiki (to save us having to maintain this list in multiple places).
* Ensures the text consistently uses `WordPressCS` instead of `WPCS`.

Closes #481
Closes #1821
Closes #1901
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants