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

Tabs in composer.lock if composer.json indented using tabs #11341

Open
maximal opened this issue Feb 18, 2023 · 4 comments
Open

Tabs in composer.lock if composer.json indented using tabs #11341

maximal opened this issue Feb 18, 2023 · 4 comments
Labels
Milestone

Comments

@maximal
Copy link
Contributor

maximal commented Feb 18, 2023

I like the way NPM handles lock files indentation: if package.json uses tabs then package-lock.json also will be indented using tabs, if the former has spaces then the latter will have spaces.

Maybe it would be semantically correct to implement the similar behavior in Composer, so that composer.lock was indented the way composer.json is.

Also, this issue is linked to #3192

@maximal maximal changed the title Tabs in composer.lock if composer.json indented using tabs Tabs in composer.lock if composer.json indented using tabs Feb 18, 2023
@Seldaek
Copy link
Member

Seldaek commented Mar 20, 2023

Yeah I guess we could do that, sounds reasonable although a little work for not much value IMO as the lock file should not really be opened/edited.

@Seldaek Seldaek added this to the Nice To Have milestone Mar 20, 2023
@dereuromark
Copy link
Contributor

I also think the composer.json file itself, as outlined in the linked ticket, should be the prio here.

@maximal
Copy link
Contributor Author

maximal commented Mar 21, 2023

@Seldaek, at least users using tabs will have much smaller composer.lock :-)

I guess, I could do this, I only need to find where the JSON files generation is located.

@maximal
Copy link
Contributor Author

maximal commented Mar 21, 2023

I taught JsonFile to preserve indentation when writing files. See #11390.
Maybe this behavior will be enough. Can you check the pull request please?

So, it is sufficient to once reformat composer.lock using tabs and then Composer will be preserving tabs in it.

This is not what I originally wanted (in this issue specifically), but at least something to move on. I don’t know yet how to pass composer.json indentation to Locker instance.

@Seldaek Seldaek modified the milestones: Nice To Have, 2.6 Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants