Made patches.lock.json configurable #533#584
Conversation
| if (!is_string($lock_file)) { | ||
| $lock_file = 'patches-lock-file'; | ||
| } |
There was a problem hiding this comment.
This block isn't necessary anymore -- composer configurable plugin handles setting a default for you, so if it's not specified, it's whatever is hardcoded in the config above.
| if ($base === 'composer') { | ||
| return "$dir/$lock_file"; | ||
| } | ||
|
|
||
| return "$dir/$base-$lock_file"; |
There was a problem hiding this comment.
Right now, if you set COMPOSER=composer-foo.json and run any of the composer patches commands, you'll get composer-foo-patches.lock.json. If we set patches-lock-file to asdf.lock.json and also set COMPOSER=composer-foo.json, I think we'll get composer-foo-asdf.lock.json.
This isn't incorrect, but it is something that docs and tests will need to account for. Just flagging for visibility.
| /** | ||
| * Get the path to the current patches lock file. | ||
| */ | ||
| public static function getPatchesLockFilePath(): string |
There was a problem hiding this comment.
I can't remember why this was a static function. Might be worth checking if this breaks any of the tests.
There was a problem hiding this comment.
There was a problem hiding this comment.
By not calling the method while registering, its fixed.
Parsing extra's just for the description is not worth it?
|
We use patches-file composer.patches.json and would love to be able to also use composer.patches.lock.json for consistency. |
|
Converted this to a draft until docs and tests are added + review feedback is captured. Thanks for your work on this so far! |
|
Ha @cweagans Did write the tests and docs |
Description
Relates to/closes #533
Related tasks
Other notes
I'm new to the composer-plugin world, so have no clue that this is even the correct path.
Before writing docs and tests can someone confirm this is the correct path?