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

Output Report: Format MultiLine Strings to Yaml Literal Style #9

Open
gregberns opened this issue Jan 22, 2021 · 0 comments
Open

Output Report: Format MultiLine Strings to Yaml Literal Style #9

gregberns opened this issue Jan 22, 2021 · 0 comments

Comments

@gregberns
Copy link
Owner

When fcheck runs a process which emits multi-line output, like logging or a stacktrace, it would be helpful to render the yaml with linebreaks inseead of \n within the string.

Yaml supports block scalars, specifically the 'literal' style, indicated by a pipe (|).

---
tests:
  - name: a
    commands:
      - type: complete
        ...
        stdout: "[INF] Starting...\n[DBG] Table name\n[INF] dbconfig = Data Source=db\n[DBG] Tables: filemaker_rolodex\n[DBG] Anon START[ERR] Faulted: Errors occurred (Count: 1) \nNone\n"

Which would convert the yaml report into something more readable:

---
tests:
  - name: a
    commands:
      - type: complete
        ...
        stdout: |
          [INF] Starting...
          [DBG] Table name
          [INF] dbconfig = Data Source=db
          [DBG] Tables: filemaker_rolodex\n[DBG] Anon START
          [ERR] Faulted: Errors occurred (Count: 1) 
          None

Problem

fcheck is currently using serde-yaml to serialize the yaml. That project is in turn using yaml-rust. There are serveral PRs out to yaml-rust to add support for block literals, but yaml-rust has not been responsive to merging them in.

We could look at using a different serialization library.

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

No branches or pull requests

1 participant