[sync] Add LICENSE file auto-generation from composer.json (#11)#25
Merged
[sync] Add LICENSE file auto-generation from composer.json (#11)#25
Conversation
Implements issue #11 - auto-create LICENSE file from composer.json - Added new License namespace with isolated classes: - Reader: reads license metadata from composer.json - Resolver: resolves SPDX license identifiers to templates - TemplateLoader: loads license templates from resources - PlaceholderResolver: resolves template placeholders (year, organization, author, project) - Generator: orchestrates license file generation - Added license templates for: MIT, BSD-2-Clause, BSD-3-Clause, Apache-2.0, ISC, GPL-3.0-or-later, LGPL-3.0-or-later, MPL-2.0, Unlicense - Updated SyncCommand to call generateLicense() method - Added unit tests for all License classes Behavior: - If LICENSE already exists, skip generation - If no license in composer.json, warn and skip - If unsupported license, warn and skip - Only generates for single supported SPDX license
Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends
dev-tools:syncto automatically generate aLICENSEfile when one does not exist and a supported license is declared incomposer.json. This ensures package metadata consistency between Composer and the repository.Changes
Licensenamespace with isolated classes:Reader: reads license metadata from composer.jsonResolver: resolves SPDX license identifiers to templatesTemplateLoader: loads license templates from resourcesPlaceholderResolver: resolves template placeholders (year, organization, author, project)Generator: orchestrates license file generationSyncCommandto callgenerateLicense()methodBehavior
LICENSEalready exists → skip generationcomposer.json→ warn and skipTesting
composer dev-tools tests -- --filter="License"Closes #11