Commit Graph

8 Commits

Author SHA1 Message Date
Jinguang Dong 638de6f4d3 refactor: improve code quality and integrate SPDX license conversion
- Update README_OSS.md with comprehensive documentation for new features
- Refactor generate_readme_opensource.py to integrate SPDX conversion
- Refactor spdx_license_matcher.py to use shared SPDXLicenseConverter
- Update test_validate_readme_opensource.py with better mock handling
- Add command-line arguments support to generate_readme_opensource.py
- Add SPDX license validation to generate_readme_opensource.py
- Improve error handling and logging across all modules

Changes:
- README_OSS.md: Add documentation for SPDX features, reference data generation,
  and complete usage examples with FAQ section
- generate_readme_opensource.py: Add argparse CLI, SPDX converter integration,
  license validation, and improved type hints
- spdx_license_matcher.py: Refactor to use shared SPDXLicenseConverter,
  add --column option, improve error handling, add summary output
- test_validate_readme_opensource.py: Fix test mock issues, add docstrings

Signed-off-by: Jinguang Dong <dongjinguang@huawei.com>
2026-02-12 11:17:28 +08:00
Jinguang Dong ff6fc461d7 refactor: improve code quality and integrate SPDX license conversion
- Update README_OSS.md with comprehensive documentation for new features
- Refactor generate_readme_opensource.py to integrate SPDX conversion
- Refactor spdx_license_matcher.py to use shared SPDXLicenseConverter
- Update test_validate_readme_opensource.py with better mock handling
- Add command-line arguments support to generate_readme_opensource.py
- Add SPDX license validation to generate_readme_opensource.py
- Improve error handling and logging across all modules

Changes:
- README_OSS.md: Add documentation for SPDX features, reference data generation,
  and complete usage examples with FAQ section
- generate_readme_opensource.py: Add argparse CLI, SPDX converter integration,
  license validation, and improved type hints
- spdx_license_matcher.py: Refactor to use shared SPDXLicenseConverter,
  add --column option, improve error handling, add summary output
- test_validate_readme_opensource.py: Fix test mock issues, add docstrings

Signed-off-by: Jinguang Dong <dongjinguang@huawei.com>
2026-02-10 19:18:49 +08:00
Jinguang Dong 932a68b33e Add SPDX license standardization for reference data generation
- Add spdx_converter.py to convert license names to SPDX standard identifiers
- Add generate_reference_data.py to generate reference_data.json from README.OpenSource files
- Update data/spdx.json with latest SPDX license list (712 licenses)
- Update test/reference_data.json with SPDX-standardized license identifiers
- Add unit tests for SPDX converter (10 test methods, 28 subtests)
- Add Python project configuration files (pyproject.toml, requirements.txt)

Features:
- Converts license variants like "MIT License" -> "MIT", "GPL-2.0" -> "GPL-2.0-only"
- Handles WITH exception format (e.g., "Apache-2.0 WITH LLVM-exception")
- Supports multiple license separators (;, /, ,, or, OR)
- Validates all generated license identifiers against SPDX standard

All license identifiers in reference_data.json are now valid SPDX standard.

Signed-off-by: Jinguang Dong <dongjinguang@huawei.com>
2026-02-10 18:03:16 +08:00
Jinguang Dong 4d9fa1c560 Description:[fix] fixed oss config parameter generate sequence
Bug: https://gitee.com/openharmony/developtools_integration_verification/issues/IBJ3EA
Test: script generate and check config file

Signed-off-by: Jinguang Dong <dongjinguang@huawei.com>
2025-01-21 14:26:03 +08:00
Jinguang Dong 5ba287c84f Description:[feature]optimize description for readme opensrouce tools
Bug: https://gitee.com/openharmony/developtools_integration_verification/issues/IB6IUH
Test: The unit test can run through

Signed-off-by: Jinguang Dong <dongjinguang@huawei.com>
2024-11-23 11:51:01 +08:00
Jinguang Dong 8e335ba71a Description:[feature] Provide SPDX metadata integration and automated license
name matching for SBOM and README.OpenSource validation
Bug: https://gitee.com/openharmony/developtools_integration_verification/issues/IB1BR3
Test: Give the detailed test verification procedure

Signed-off-by: Jinguang Dong <dongjinguang@huawei.com>
2024-11-01 11:10:34 +08:00
Jinguang Dong 1f5bbc0e14 Description:[feature] optimize readme opensource validate content
Bug: https://gitee.com/openharmony/developtools_integration_verification/issues/IAT8BB
Test: run validate_readme_opensource.py

Signed-off-by: Jinguang Dong <dongjinguang@huawei.com>
2024-09-24 11:48:48 +08:00
Jinguang Dong bf37a8a33a Description:[feature] opensource tools for generate and validate
Bug: https://gitee.com/openharmony/developtools_integration_verification/issues/IARN6Y
Test: run generate_readme_opensource and validate_readme_opensource
tools

Signed-off-by: Jinguang Dong <dongjinguang@huawei.com>
2024-09-18 14:43:53 +08:00