-
-
Notifications
You must be signed in to change notification settings - Fork 196
Avoid remove author name #444
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
Avoid remove author name #444
Conversation
Did you check #441? Can you explain what this changes? I don't get it by reading the code. |
Search for "name" and "description" just once each. It does not continue searching for more matches of the same word if it is already found, to be sure only the root name is removed and keep the name on the author section. Already check #441 and I'm trying to solve comment #440 (comment) |
I think this is still not a complete solution. You should not delete name / description in any case that is not a skeleton. But if you are going to do something like that, better to do:
instead of doing a regexp |
@hectorprats It's not a complete solution but a partial solution just for #440 (comment) In I guess also applys to |
Ok, @HugoSantiagoBecerraAdan . But your solution does not solve the problem if there is no 'name' key and yes a subkey inside authors. If I do a create-project to make a git clone & composer install, it can not erase things from the composer.json In a skeleton it makes sense. But never in other cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks.
If a composer.json doesn't have a name / description, that's a bug in this file IMHO.
A solution could be to use the manipulator if possible, and use the regex only as a fallback for older composer versions. |
There is no need to look for a solution when there is no problem ;) |
dc8a059
to
cd04581
Compare
Thank you @HugoSantiagoBecerraAdan. |
@nicolas-grekas It's one thing to keep the code simple, and another to do ugly things. The system of using a regexp to cancel 2 keys of a json is very very ugly. And in the end composer is full of ugly things. For example (although this is another topic), there are dozens of 'if' where you check 2 terms and first check the slow and then the fast. Or like the other day. Everywhere in the code the labels are closed with </ info>, and if I make a PR to homogenize and remove the </>, someone prefers to leave the 2 forms. Simple code? Use the methods created for it, and if they are not compatible with something, make that method compatible. |
@hectorprats thanks for the opinion. Looking forward to your PR since you seem to care. |
Fixes part of #440