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

Fix/cpp gen storing yaml #900

Merged
merged 16 commits into from
Dec 19, 2024

Conversation

SGSSGene
Copy link
Contributor

@SGSSGene SGSSGene commented Dec 16, 2024

This PR addresses multiple concerns at once:

  1. It adds special handling of CWL Expression type
  2. It now handles simplification of types by respecting the typeDSL option
  3. It also handles mapPredicate when doing map ⇔ list conversions. (and not only mapSubject)
  4. added a DocumentRootType type and load_document and store_document functions.
  5. Added a store_config object, which allows to control simplification of types, list to map conversion and partial YAML-tag output (all very helpful when debugging).
  6. It wraps the generated code into a cpp_gen namespace to avoid symbol spilling into other parts of c++ programs.

A basic program that can load and save(print) CWL tool description files (or any DocumentRootType type):

#include "cwl_v1_2.h"

#include <iostream>

namespace cwl = w3id_org::cwl;
int main(int argc, char** argv) {
    if (argc != 2) return 1;

    auto tool = cwl::load_document(argv[1]);
    cwl::store_document(tool, std::cout);
    return 0;
}

@SGSSGene SGSSGene force-pushed the fix/cpp-gen_storing_yaml branch from 6c6c443 to 1bb72ee Compare December 16, 2024 07:55
@SGSSGene SGSSGene marked this pull request as draft December 16, 2024 08:03
@SGSSGene SGSSGene force-pushed the fix/cpp-gen_storing_yaml branch from ed32cbb to 5975cb0 Compare December 16, 2024 08:10
@SGSSGene SGSSGene force-pushed the fix/cpp-gen_storing_yaml branch from 5975cb0 to 1f66ad8 Compare December 16, 2024 09:47
@SGSSGene SGSSGene force-pushed the fix/cpp-gen_storing_yaml branch from 1f66ad8 to 710eaac Compare December 18, 2024 07:19
@SGSSGene SGSSGene force-pushed the fix/cpp-gen_storing_yaml branch from 859fe2e to d8d734d Compare December 18, 2024 07:38
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 98.83721% with 1 line in your changes missing coverage. Please review.

Project coverage is 83.29%. Comparing base (3dc90de) to head (5ef98ca).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
schema_salad/cpp_codegen.py 98.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #900      +/-   ##
==========================================
+ Coverage   83.13%   83.29%   +0.15%     
==========================================
  Files          22       22              
  Lines        4899     4944      +45     
  Branches     1177     1182       +5     
==========================================
+ Hits         4073     4118      +45     
  Misses        548      548              
  Partials      278      278              

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

@SGSSGene SGSSGene force-pushed the fix/cpp-gen_storing_yaml branch from 920e317 to 5ef98ca Compare December 18, 2024 08:25
@SGSSGene SGSSGene marked this pull request as ready for review December 19, 2024 10:06
@mr-c mr-c merged commit 9fd211e into common-workflow-language:main Dec 19, 2024
24 of 25 checks passed
@SGSSGene SGSSGene deleted the fix/cpp-gen_storing_yaml branch December 19, 2024 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants