# 2.1 YAML processing bug

**URL:** <https://discuss.circleci.com/t/2-1-yaml-processing-bug/26975>\
**Category:** Bug Reports\
**Created:** [December 5, 2018, 7:53am UTC](https://discuss.circleci.com/t/2-1-yaml-processing-bug/26975 "2018-12-05T07:53:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rnitta](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@rnitta](https://discuss.circleci.com/u/rnitta)\
**Post date:** [December 5, 2018, 7:53am UTC](https://discuss.circleci.com/t/2-1-yaml-processing-bug/26975/1 "2018-12-05T07:53:11Z")

</div>

I write `.circleci/config.yml` like this,

```auto
version: 2.1

jobs:
  build:
    executor: default
    steps:
      - run:
          no_output_timeout: 1200
          command: >
            bundle exec rspec --profile 10
                              --format RspecJunitFormatter
                              --out test-results/rspec/results.xml
                              --format html
                              --out artifacts/rspec/results.html
                              --format progress
                              $(circleci tests glob "spec/ **/** /*_spec.rb" | circleci tests split --split-by=timings)

```

and processed yml is here

```auto
version: 2
jobs:
  build:
    steps:
    - run:
        no_output_timeout: 1200
        command: |
          bundle exec rspec --profile 10
                            --format RspecJunitFormatter
                            --out test-results/rspec/results.xml
                            --format html
                            --out artifacts/rspec/results.html
                            --format progress
                            $(circleci tests glob "spec/ **/** /*_spec.rb" | circleci tests split --split-by=timings)

```

the point is that  
`command: >` is converted to `command: |` .

`>` changes line-brakes to whitescpaces,  
but `|` does not.

Local Circleci CLI behave as same as this. ( `$ ciecleci config process` )

It seems a bug for me.  
thoughts?

---

<div class="post-metadata">

**Author:** ![Eric](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/eric/32/2759_2.png) [@Eric](https://discuss.circleci.com/u/Eric)\
**Post date:** [December 5, 2018, 11:08am UTC](https://discuss.circleci.com/t/2-1-yaml-processing-bug/26975/2 "2018-12-05T11:08:57Z")

</div>

Hi there, this looks like it’s not a bug.

If you use the yaml folding indicator `>`, it will only fold away newlines when two adjacent lines have the same level of indentation.

This snippet is likely what you’re looking for:

```auto
echo "
version: 2.1

jobs:
  build:
    machine: true
    steps:
      - run:
          no_output_timeout: 1200
          command: >
            bundle exec rspec --profile 10
            --format RspecJunitFormatter
" | circleci config process -
__bp_preexec_invoke_exec "$_"
__bp_preexec_invoke_exec "$_"
version: 2
jobs:
  build:
    machine: true
    steps:
    - run:
        no_output_timeout: 1200
        command: |
          bundle exec rspec --profile 10 --format RspecJunitFormatter
workflows:
  version: 2
  workflow:
    jobs:
    - build

# Original config.yml file:
#
# version: 2.1
#
# jobs:
# build:
# machine: true
# steps:
# - run:
# no_output_timeout: 1200
# command: >
# bundle exec rspec --profile 10
# --format RspecJunitFormatter

```

This snippet only has one extra space of indentation on the `--format` line, but that’s enough to disable the `>` folding behavior:

```auto
echo "
version: 2.1

jobs:
  build:
    machine: true
    steps:
      - run:
          no_output_timeout: 1200
          command: >
            bundle exec rspec --profile 10
             --format RspecJunitFormatter
" | circleci config process -
__bp_preexec_invoke_exec "$_"
__bp_preexec_invoke_exec "$_"
version: 2
jobs:
  build:
    machine: true
    steps:
    - run:
        no_output_timeout: 1200
        command: |
          bundle exec rspec --profile 10
           --format RspecJunitFormatter
workflows:
  version: 2
  workflow:
    jobs:
    - build

# Original config.yml file:
#
# version: 2.1
#
# jobs:
# build:
# machine: true
# steps:
# - run:
# no_output_timeout: 1200
# command: >
# bundle exec rspec --profile 10
# --format RspecJunitFormatter

```

You can compare the results of the following with [an online yaml parser](http://yaml-online-parser.appspot.com/).

I expected folding of newlines and indentations in your original code, but it looks like the [yaml spec specifically has examples to illustrate this is intended](http://yaml.org/spec/1.2/spec.html#id2796800).
