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

validate composer.json #43

Closed
staabm opened this issue Aug 5, 2014 · 6 comments
Closed

validate composer.json #43

staabm opened this issue Aug 5, 2014 · 6 comments

Comments

@staabm
Copy link
Contributor

staabm commented Aug 5, 2014

phar-composer commands assume the composer.json provided is valid.

In case it is not valid it sometimes produces strange things, e.g. name a project "myproject" (without a vendor prefix, which of course is invalid).
-> it will create a "yproject.phar" (without the leading "m"). It took some time to find out, that this problems are caused by my invalid composer.json.

phar-composer could do a better job and do a composer validate before each runs its own commands. In case of errors, skip its own command and print the error.

@clue
Copy link
Owner

clue commented Jun 6, 2015

Interesting suggestion :-)

Right now, this project does not necessarily depend on composer at all. You can use this tool to bundle a local project directory without requiring composer.

I considered embedding composer (#11), in which case it certainly makes sense to also add a validation step.

What are your thoughts?

@staabm
Copy link
Contributor Author

staabm commented Jun 11, 2015

Not sure how much dev-time it would take to embbed composer and how big the resulting phar-composer will be. This 2 parameters would be the actual drivers IMO.

If this issue is the only reason for embedding composer we could also just use composer validate in case composer is available (which is very likely as you already mentioned in the referenced ticket).

@clue
Copy link
Owner

clue commented Jun 11, 2015

we could also just use composer validate in case composer is available

Sounds like a sane approach (sufficiently easy to implement independently of #11). Would you care to file a PR? :)

@staabm
Copy link
Contributor Author

staabm commented Jun 11, 2015

Will PR tomorrow

staabm added a commit to staabm/phar-composer that referenced this issue Jun 18, 2015
staabm added a commit to staabm/phar-composer that referenced this issue Jun 26, 2015
staabm added a commit to staabm/phar-composer that referenced this issue Jun 26, 2015
staabm added a commit to staabm/phar-composer that referenced this issue Jun 26, 2015
@kasperg
Copy link

kasperg commented Aug 25, 2015

An alternate approach would be to use justinrainbow/json-schema and the schema for composer.json.

@clue
Copy link
Owner

clue commented Nov 8, 2019

@staabm Thank you for the suggestion, I understand where you're coming from, but I'm having to close this as out of scope as per #88

Please report back and/or open a new PR if you feel this is still needed and we can reconsider this 👍

@clue clue closed this as completed Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants