Within our current ./composer.json file the response to

drush composer diagnose :-

[UnexpectedValueException]
Could not parse version constraint ^1.0.20: Invalid version string "^1.0.20"

we want here is a (~)tidle not a (^)caret

"type": "project",
"license": "GPL-2.0+",
"require": {
- "composer/installers": "^1.0.20",
+ "composer/installers": "~1.0.20",
"drupal/core": "~8.0"
},

It is difficult to gauge the importance of this issue..

This is a subtle bug and future or current developer may be pulling his/her hair out
wondering why the dependancy tree is not quite was is expected.

Anyway, an automated check to sweep all syntax like bugs from composer.json files
seems like a good thing to have in our pre-release check list.

CommentFileSizeAuthor
composer-0.patch335 bytesmartin107

Comments

timmillwood’s picture

Status: Active » Closed (cannot reproduce)

Are you using the composer drush plugin? because I don't have the command drush composer diagnose.]

Both composer diagnose and composer validate work fine for me.

I would rather we used the (^)caret rather then the (~)tidle, because the tidle only allows for patch releases the caret will allow us to track minor releases too.

martin107’s picture

Status: Closed (cannot reproduce) » Needs review

Here is my output from 3 relevant commands

I hope you will take the line - that not matter how I found the error... the error does exist!

That is the caret symbol makes not sense in that context.

So I am reopening the issue.

drush composer --version
Composer version 1.0.0-alpha8 @release_date@

drush --version
Drush Version : 8.0-dev

drush composer
______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
/_/
Composer version 1.0.0-alpha8 @release_date@

Usage:
[options] command [arguments]

Options:
--help -h Display this help message.
--quiet -q Do not output any message.
--verbose -v|vv|vvv Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
--version -V Display this application version.
--ansi Force ANSI output.
--no-ansi Disable ANSI output.
--no-interaction -n Do not ask any interactive question.
--profile Display timing and memory usage information
--working-dir -d If specified, use the given directory as working directory.

Available commands:
about Short information about Composer
archive Create an archive of this composer package
config Set config options
create-project Create new project from a package into given directory.
depends Shows which packages depend on the given package
diagnose Diagnoses the system to identify common errors.
dump-autoload Dumps the autoloader
dumpautoload Dumps the autoloader
global Allows running commands in the global composer dir ($COMPOSER_HOME).
help Displays help for a command
init Creates a basic composer.json file in current directory.
install Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
licenses Show information about licenses of dependencies
list Lists commands
require Adds required packages to your composer.json and installs them
run-script Run the scripts defined in composer.json.
search Search for packages
show Show information about packages
status Show a list of locally modified packages
update Updates your dependencies to the latest version according to composer.json, and updates the composer.lock file.
validate Validates a composer.json

timmillwood’s picture

I hope you will take the line - that not matter how I found the error... the error does exist

I'm not sure it does.

That is the caret symbol makes not sense in that context.

The caret symbol makes perfect sense.

martin107’s picture

Status: Needs review » Closed (works as designed)

Ah my mistake, just to be complete..... for example

http://blog.madewithlove.be/post/tilde-and-caret-constraints/

^4.1.3 (most used) means >=4.1.3,<5.0.0,
^4.1 means >=4.1.0,<5.0.0, same as ~4.1 but:
^0.4 means >=0.4.0,<0.5.0, this is different from ~0.4 and is more useful for defining backwards compatible version ranges.
^4 means >=4.0.0,<5.0.0 which is the same as ~4 and 4.*.