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

Prune empty sections in composer.json #1053

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fredden
Copy link
Contributor

@fredden fredden commented Dec 31, 2023

This pull request removes empty sections from composer.json when they are defined as optional (or more specifically, not specified as required) according to the schema.

I have hidden this feature behind an optional constructor property, so that other users of this package can decide if they also want to have empty-and-optional elements removed during normalisation.

The removal happens after normalisation so we can process nesting properly.

I chose to not remove empty elements which are not defined in the schema.

Related to composer/composer#7691

Copy link

codecov bot commented Dec 31, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (b6c84b1) 96.46% compared to head (2a5e4d2) 95.74%.

Files Patch % Lines
src/SchemaNormalizer.php 90.90% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1053      +/-   ##
============================================
- Coverage     96.46%   95.74%   -0.72%     
- Complexity      196      203       +7     
============================================
  Files            32       32              
  Lines           764      776      +12     
============================================
+ Hits            737      743       +6     
- Misses           27       33       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@localheinz localheinz self-assigned this Jan 7, 2024
@localheinz localheinz force-pushed the prune-empty-elements-in-composerjson branch 2 times, most recently from 74c338f to 2f2c606 Compare February 17, 2024 12:40
@localheinz localheinz force-pushed the prune-empty-elements-in-composerjson branch from 2f2c606 to 2a5e4d2 Compare February 17, 2024 14:02
@localheinz localheinz changed the title Prune empty sections in composer.json Prune empty sections in composer.json Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants