common-workflow-language / schema_salad

Semantic Annotations for Linked Avro Data
https://www.commonwl.org/v1.2/SchemaSalad.html
Apache License 2.0
72 stars 62 forks source link

feat: generate spdx identifier for c++ code #753

Closed SGSSGene closed 10 months ago

SGSSGene commented 10 months ago

This will allow to set spdx copyright_text and license_identifier: (currently c++ only)

e.g.:

schema-salad-tools --codegen cpp somedescription.yml --codegen-spdx-copyright-text '2012 Author Name A <namea@example.com>' '2016 Author Name B <nameb@example.com>' --codegen-spdx-license-identifier 'GPL-3.0-only' 

will produce:

// SPDX-FileCopyrightText: 2012 Author Name A <namea@example.com>
// SPDX-FileCopyrightText: 2016 Author Name B <nameb@example.com>
// SPDX-License-Identifier: GPL-3.0-only
...

In case of CWL it would be:

schema-salad-tools --codegen cpp ../cwl-v1.2/CommonWorkflowLanguage.yml --codegen-spdx-copyright-text '"Copyright 2016-2023 CWL Project Contributors' --codegen-spdx-license-identifier 'Apache-2.0'

producing:

// SPDX-FileCopyrightText: Copyright 2016-2023 CWL Project Contributors
// SPDX-License-Identifier: Apache-2.0
...
codecov[bot] commented 10 months ago

Codecov Report

Merging #753 (22f71e7) into main (c2e1acd) will increase coverage by 0.03%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #753      +/-   ##
==========================================
+ Coverage   83.65%   83.68%   +0.03%     
==========================================
  Files          22       22              
  Lines        4571     4580       +9     
  Branches     1236     1239       +3     
==========================================
+ Hits         3824     3833       +9     
  Misses        483      483              
  Partials      264      264              
Files Coverage Δ
schema_salad/codegen.py 94.64% <ø> (ø)
schema_salad/cpp_codegen.py 81.98% <100.00%> (+0.38%) :arrow_up:
schema_salad/main.py 77.29% <100.00%> (+0.24%) :arrow_up:
SGSSGene commented 10 months ago

Thank you! Please add test coverage

Very good! This showed that the previous tests weren't working properly... Now they should all run.