From b73d8529b56c77debe8c8f0e538e40169423c77d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=86=E3=82=8B=E3=82=86=E3=82=8B?= Date: Tue, 12 Sep 2023 08:51:27 +0900 Subject: [PATCH] feat: Add option in `block-sequence-hyphen-indicator-newline` (#259) * feat: Add an option to block-sequence-hyphen-indicator-newline * test: Rename test suite `block-mapping-only` to `nested-hyphen-and-block-mapping-newline` * test: new test suite for `block-sequence-hyphen-indicator-newline` * docs: Update for new option in `block-sequence-hyphen-indicator-newline` * test: add test case for block mapping * Create thick-eyes-march.md --------- Co-authored-by: Yosuke Ota --- .changeset/thick-eyes-march.md | 5 +++ ...block-sequence-hyphen-indicator-newline.md | 22 +++++++++++++ ...block-sequence-hyphen-indicator-newline.ts | 16 ++++++++-- .../yaml-test-suite-for-always/_config.json | 3 +- .../mapping-errors.json | 22 +++++++++++++ .../mapping-input.yaml | 3 ++ .../mapping-output.yml | 8 +++++ .../6BCT-errors.json | 7 ++++ .../6BCT-input.yaml | 3 ++ .../6BCT-output.yml | 5 +++ .../735Y-errors.json | 7 ++++ .../735Y-input.yaml | 6 ++++ .../735Y-output.yml | 6 ++++ .../93JH-errors.json | 7 ++++ .../93JH-input.yaml | 4 +++ .../93JH-output.yml | 6 ++++ .../9U5K-errors.json | 17 ++++++++++ .../9U5K-input.yaml | 8 +++++ .../9U5K-output.yml | 12 +++++++ .../AZW3-errors.json | 12 +++++++ .../AZW3-input.yaml | 2 ++ .../AZW3-output.yml | 5 +++ .../FH7J-errors.json | 7 ++++ .../FH7J-input.yaml | 5 +++ .../FH7J-output.yml | 7 ++++ .../J7PZ-errors.json | 17 ++++++++++ .../J7PZ-input.yaml | 7 ++++ .../J7PZ-output.yml | 11 +++++++ .../JQ4R-errors.json | 7 ++++ .../JQ4R-input.yaml | 3 ++ .../JQ4R-output.yml | 5 +++ .../RZP5-errors.json | 12 +++++++ .../RZP5-input.yaml | 15 +++++++++ .../RZP5-output.yml | 16 ++++++++++ .../RZT7-errors.json | 12 +++++++ .../RZT7-input.yaml | 26 +++++++++++++++ .../RZT7-output.yml | 29 +++++++++++++++++ .../UGM3-errors.json | 12 +++++++ .../UGM3-input.yaml | 29 +++++++++++++++++ .../UGM3-output.yml | 32 +++++++++++++++++++ .../V9D5-errors.json | 12 +++++++ .../V9D5-input.yaml | 3 ++ .../V9D5-output.yml | 6 ++++ .../W42U-errors.json | 7 ++++ .../W42U-input.yaml | 6 ++++ .../W42U-output.yml | 8 +++++ .../XW4D-errors.json | 12 +++++++ .../XW4D-input.yaml | 16 ++++++++++ .../XW4D-output.yml | 17 ++++++++++ .../_config.json | 14 ++++++++ .../mapping-errors.json | 12 +++++++ .../mapping-input.yaml | 3 ++ .../mapping-output.yml | 6 ++++ .../mapping-errors.json | 7 ++++ .../mapping-input.yaml | 3 ++ .../mapping-output.yml | 5 +++ .../3ALJ-errors.json | 7 ++++ .../3ALJ-input.yaml | 3 ++ .../3ALJ-output.yml | 5 +++ .../6BCT-errors.json | 12 +++++++ .../6BCT-input.yaml | 3 ++ .../6BCT-output.yml | 6 ++++ .../735Y-errors.json | 7 ++++ .../735Y-input.yaml | 6 ++++ .../735Y-output.yml | 6 ++++ .../93JH-errors.json | 7 ++++ .../93JH-input.yaml | 4 +++ .../93JH-output.yml | 6 ++++ .../9U5K-errors.json | 17 ++++++++++ .../9U5K-input.yaml | 8 +++++ .../9U5K-output.yml | 12 +++++++ .../A2M4-errors.json | 7 ++++ .../A2M4-input.yaml | 4 +++ .../A2M4-output.yml | 6 ++++ .../AZW3-errors.json | 12 +++++++ .../AZW3-input.yaml | 2 ++ .../AZW3-output.yml | 5 +++ .../FH7J-errors.json | 7 ++++ .../FH7J-input.yaml | 5 +++ .../FH7J-output.yml | 7 ++++ .../J7PZ-errors.json | 17 ++++++++++ .../J7PZ-input.yaml | 7 ++++ .../J7PZ-output.yml | 11 +++++++ .../JQ4R-errors.json | 7 ++++ .../JQ4R-input.yaml | 3 ++ .../JQ4R-output.yml | 5 +++ .../RZP5-errors.json | 12 +++++++ .../RZP5-input.yaml | 15 +++++++++ .../RZP5-output.yml | 16 ++++++++++ .../RZT7-errors.json | 12 +++++++ .../RZT7-input.yaml | 26 +++++++++++++++ .../RZT7-output.yml | 29 +++++++++++++++++ .../UGM3-errors.json | 12 +++++++ .../UGM3-input.yaml | 29 +++++++++++++++++ .../UGM3-output.yml | 32 +++++++++++++++++++ .../V9D5-errors.json | 12 +++++++ .../V9D5-input.yaml | 3 ++ .../V9D5-output.yml | 6 ++++ .../W42U-errors.json | 12 +++++++ .../W42U-input.yaml | 6 ++++ .../W42U-output.yml | 9 ++++++ .../XW4D-errors.json | 12 +++++++ .../XW4D-input.yaml | 16 ++++++++++ .../XW4D-output.yml | 17 ++++++++++ .../_config.json | 14 ++++++++ .../mapping-errors.json | 17 ++++++++++ .../mapping-input.yaml | 3 ++ .../mapping-output.yml | 7 ++++ .../229Q-errors.json | 12 +++++++ .../229Q-input.yaml | 8 +++++ .../229Q-output.yml | 7 ++++ .../3ALJ-errors.json | 7 ++++ .../3ALJ-input.yaml | 3 ++ .../3ALJ-output.yml | 5 +++ .../6BCT-errors.json | 7 ++++ .../6BCT-input.yaml | 3 ++ .../6BCT-output.yml | 5 +++ .../735Y-errors.json | 7 ++++ .../735Y-input.yaml | 6 ++++ .../735Y-output.yml | 6 ++++ .../93JH-errors.json | 7 ++++ .../93JH-input.yaml | 4 +++ .../93JH-output.yml | 4 +++ .../A2M4-errors.json | 7 ++++ .../A2M4-input.yaml | 4 +++ .../A2M4-output.yml | 6 ++++ .../FH7J-errors.json | 7 ++++ .../FH7J-input.yaml | 5 +++ .../FH7J-output.yml | 5 +++ .../RZP5-errors.json | 7 ++++ .../RZP5-input.yaml | 15 +++++++++ .../RZP5-output.yml | 15 +++++++++ .../W42U-errors.json | 7 ++++ .../W42U-input.yaml | 6 ++++ .../W42U-output.yml | 8 +++++ .../XW4D-errors.json | 7 ++++ .../XW4D-input.yaml | 16 ++++++++++ .../XW4D-output.yml | 16 ++++++++++ .../_config.json | 14 ++++++++ .../mapping-errors.json | 7 ++++ .../mapping-input.yaml | 3 ++ .../mapping-output.yml | 5 +++ .../yaml-test-suite-for-never/_config.json | 3 +- .../mapping-errors.json | 17 ++++++++++ .../mapping-input.yaml | 6 ++++ .../mapping-output.yml | 4 +++ .../valid/mapping-input.yaml | 7 ++++ tools/update-fixtures.ts | 16 ++++++++-- 148 files changed, 1403 insertions(+), 7 deletions(-) create mode 100644 .changeset/thick-eyes-march.md create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-always/mapping-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-always/mapping-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-always/mapping-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/6BCT-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/6BCT-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/6BCT-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/735Y-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/735Y-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/735Y-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/93JH-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/93JH-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/93JH-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/9U5K-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/9U5K-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/9U5K-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/AZW3-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/AZW3-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/AZW3-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/FH7J-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/FH7J-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/FH7J-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/J7PZ-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/J7PZ-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/J7PZ-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/JQ4R-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/JQ4R-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/JQ4R-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZP5-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZP5-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZP5-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZT7-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZT7-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZT7-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/UGM3-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/UGM3-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/UGM3-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/V9D5-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/V9D5-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/V9D5-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/W42U-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/W42U-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/W42U-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/XW4D-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/XW4D-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/XW4D-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/_config.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/mapping-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/mapping-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/mapping-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-default/mapping-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-default/mapping-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-default/mapping-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/3ALJ-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/3ALJ-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/3ALJ-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/6BCT-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/6BCT-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/6BCT-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/735Y-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/735Y-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/735Y-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/93JH-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/93JH-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/93JH-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/9U5K-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/9U5K-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/9U5K-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/A2M4-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/A2M4-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/A2M4-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/AZW3-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/AZW3-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/AZW3-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/FH7J-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/FH7J-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/FH7J-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/J7PZ-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/J7PZ-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/J7PZ-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/JQ4R-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/JQ4R-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/JQ4R-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZP5-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZP5-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZP5-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZT7-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZT7-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZT7-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/UGM3-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/UGM3-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/UGM3-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/V9D5-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/V9D5-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/V9D5-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/W42U-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/W42U-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/W42U-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/XW4D-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/XW4D-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/XW4D-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/_config.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/mapping-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/mapping-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/mapping-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/229Q-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/229Q-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/229Q-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/3ALJ-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/3ALJ-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/3ALJ-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/6BCT-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/6BCT-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/6BCT-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/735Y-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/735Y-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/735Y-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/93JH-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/93JH-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/93JH-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/A2M4-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/A2M4-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/A2M4-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/FH7J-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/FH7J-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/FH7J-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/RZP5-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/RZP5-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/RZP5-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/W42U-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/W42U-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/W42U-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/XW4D-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/XW4D-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/XW4D-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/_config.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/mapping-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/mapping-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/mapping-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-never/mapping-errors.json create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-never/mapping-input.yaml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-never/mapping-output.yml create mode 100644 tests/fixtures/rules/block-sequence-hyphen-indicator-newline/valid/mapping-input.yaml diff --git a/.changeset/thick-eyes-march.md b/.changeset/thick-eyes-march.md new file mode 100644 index 00000000..7cea1169 --- /dev/null +++ b/.changeset/thick-eyes-march.md @@ -0,0 +1,5 @@ +--- +"eslint-plugin-yml": minor +--- + +feat: add `blockMapping` option in `block-sequence-hyphen-indicator-newline` diff --git a/docs/rules/block-sequence-hyphen-indicator-newline.md b/docs/rules/block-sequence-hyphen-indicator-newline.md index bda92d1f..cb3d98e6 100644 --- a/docs/rules/block-sequence-hyphen-indicator-newline.md +++ b/docs/rules/block-sequence-hyphen-indicator-newline.md @@ -41,6 +41,7 @@ yml/block-sequence-hyphen-indicator-newline: - error - never # or "always" - nestedHyphen: always # or "never" + - blockMapping: never # or "always" ``` - Styles @@ -49,6 +50,27 @@ yml/block-sequence-hyphen-indicator-newline: - Properties - `nestedHyphen` ... Specifies the style to apply to nested hyphens. default `"always"` + - `blockMapping` ... Specifies the style to apply to block mapping. If unspecified, the value of `Styles` is used. + +### `"blockMapping": "always"` + + + + + +```yaml +# eslint yml/block-sequence-hyphen-indicator-newline: ['error', 'never', { blockMapping: 'always' }] + +# ✓ GOOD +- + keyA: "GOOD" +- { keyB: "GOOD" } + +# ✗ BAD +- key: "BAD" +``` + + ## :couple: Related rules diff --git a/src/rules/block-sequence-hyphen-indicator-newline.ts b/src/rules/block-sequence-hyphen-indicator-newline.ts index b597c084..f377ad8e 100644 --- a/src/rules/block-sequence-hyphen-indicator-newline.ts +++ b/src/rules/block-sequence-hyphen-indicator-newline.ts @@ -17,6 +17,7 @@ export default createRule("block-sequence-hyphen-indicator-newline", { type: "object", properties: { nestedHyphen: { enum: ["always", "never"] }, + blockMapping: { enum: ["always", "never"] }, }, additionalProperties: false, }, @@ -37,16 +38,25 @@ export default createRule("block-sequence-hyphen-indicator-newline", { const style: "never" | "always" = context.options[0] || "never"; const nestedHyphenStyle: "never" | "always" = context.options[1]?.nestedHyphen || "always"; + const blockMappingStyle: "never" | "always" = + context.options[1]?.blockMapping || style; /** * Get style from given hyphen */ - function getStyleOption(hyphen: AST.Token): "never" | "always" { + function getStyleOption( + hyphen: AST.Token, + entry: AST.YAMLContent | AST.YAMLWithMeta, + ): "never" | "always" { const next = sourceCode.getTokenAfter(hyphen); if (next && isHyphen(next)) { return nestedHyphenStyle; } + if (entry.type === "YAMLMapping" && entry.style === "block") { + return blockMappingStyle; + } + return style; } @@ -66,7 +76,7 @@ export default createRule("block-sequence-hyphen-indicator-newline", { const hasNewline = hyphen.loc.end.line < entry.loc.start.line; if (hasNewline) { - if (getStyleOption(hyphen) === "never") { + if (getStyleOption(hyphen, entry) === "never") { context.report({ loc: hyphen.loc, messageId: "unexpectedLinebreakAfterIndicator", @@ -89,7 +99,7 @@ export default createRule("block-sequence-hyphen-indicator-newline", { }); } } else { - if (getStyleOption(hyphen) === "always") { + if (getStyleOption(hyphen, entry) === "always") { context.report({ loc: hyphen.loc, messageId: "expectedLinebreakAfterIndicator", diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-always/_config.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-always/_config.json index bee741de..f60aca75 100644 --- a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-always/_config.json +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-always/_config.json @@ -2,7 +2,8 @@ "options": [ "always", { - "nestedHyphen": "always" + "nestedHyphen": "always", + "blockMapping": "always" } ], "settings": { diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-always/mapping-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-always/mapping-errors.json new file mode 100644 index 00000000..da5eb84d --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-always/mapping-errors.json @@ -0,0 +1,22 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 2, + "column": 1 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 3, + "column": 1 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 3, + "column": 3 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 4, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-always/mapping-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-always/mapping-input.yaml new file mode 100644 index 00000000..d05ed3f0 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-always/mapping-input.yaml @@ -0,0 +1,3 @@ +- a: a +- - b: b +- {c: c} diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-always/mapping-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-always/mapping-output.yml new file mode 100644 index 00000000..3b44d95e --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-always/mapping-output.yml @@ -0,0 +1,8 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-always/mapping-input.yaml +- + a: a +- + - + b: b +- + {c: c} diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/6BCT-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/6BCT-errors.json new file mode 100644 index 00000000..db8ac28d --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/6BCT-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 2, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/6BCT-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/6BCT-input.yaml new file mode 100644 index 00000000..5f48cf49 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/6BCT-input.yaml @@ -0,0 +1,3 @@ +- foo: bar +- - baz + - baz diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/6BCT-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/6BCT-output.yml new file mode 100644 index 00000000..e656733b --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/6BCT-output.yml @@ -0,0 +1,5 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/6BCT-input.yaml +- + foo: bar +- - baz + - baz diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/735Y-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/735Y-errors.json new file mode 100644 index 00000000..a7f0e0d5 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/735Y-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Unexpected line break after this `-` indicator.", + "line": 2, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/735Y-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/735Y-input.yaml new file mode 100644 index 00000000..a3f13ae6 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/735Y-input.yaml @@ -0,0 +1,6 @@ +- + "flow in block" +- > + Block scalar +- !!map # Block collection + foo : bar diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/735Y-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/735Y-output.yml new file mode 100644 index 00000000..1c77d414 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/735Y-output.yml @@ -0,0 +1,6 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/735Y-input.yaml +- "flow in block" +- > + Block scalar +- !!map # Block collection + foo : bar diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/93JH-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/93JH-errors.json new file mode 100644 index 00000000..6985ad89 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/93JH-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 2, + "column": 2 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/93JH-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/93JH-input.yaml new file mode 100644 index 00000000..30c49a33 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/93JH-input.yaml @@ -0,0 +1,4 @@ + - key: value + key2: value2 + - + key3: value3 diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/93JH-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/93JH-output.yml new file mode 100644 index 00000000..51947c91 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/93JH-output.yml @@ -0,0 +1,6 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/93JH-input.yaml + - + key: value + key2: value2 + - + key3: value3 diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/9U5K-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/9U5K-errors.json new file mode 100644 index 00000000..ec1d1210 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/9U5K-errors.json @@ -0,0 +1,17 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 4, + "column": 1 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 6, + "column": 1 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 8, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/9U5K-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/9U5K-input.yaml new file mode 100644 index 00000000..63a8ed7e --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/9U5K-input.yaml @@ -0,0 +1,8 @@ +--- +# Products purchased +- item : Super Hoop + quantity: 1 +- item : Basketball + quantity: 4 +- item : Big Shoes + quantity: 1 diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/9U5K-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/9U5K-output.yml new file mode 100644 index 00000000..c68dc32f --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/9U5K-output.yml @@ -0,0 +1,12 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/9U5K-input.yaml +--- +# Products purchased +- + item : Super Hoop + quantity: 1 +- + item : Basketball + quantity: 4 +- + item : Big Shoes + quantity: 1 diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/AZW3-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/AZW3-errors.json new file mode 100644 index 00000000..0f44ed0b --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/AZW3-errors.json @@ -0,0 +1,12 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 2, + "column": 1 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 3, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/AZW3-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/AZW3-input.yaml new file mode 100644 index 00000000..c9219e95 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/AZW3-input.yaml @@ -0,0 +1,2 @@ +- bla"keks: foo +- bla]keks: foo diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/AZW3-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/AZW3-output.yml new file mode 100644 index 00000000..d712e471 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/AZW3-output.yml @@ -0,0 +1,5 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/AZW3-input.yaml +- + bla"keks: foo +- + bla]keks: foo diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/FH7J-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/FH7J-errors.json new file mode 100644 index 00000000..2198c57b --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/FH7J-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 6, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/FH7J-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/FH7J-input.yaml new file mode 100644 index 00000000..2b07b28b --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/FH7J-input.yaml @@ -0,0 +1,5 @@ +- !!str +- + !!null : a + b: !!str +- !!str : !!null diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/FH7J-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/FH7J-output.yml new file mode 100644 index 00000000..2f733c21 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/FH7J-output.yml @@ -0,0 +1,7 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/FH7J-input.yaml +- !!str +- + !!null : a + b: !!str +- + !!str : !!null diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/J7PZ-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/J7PZ-errors.json new file mode 100644 index 00000000..b39e2c24 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/J7PZ-errors.json @@ -0,0 +1,17 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 6, + "column": 1 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 7, + "column": 1 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 8, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/J7PZ-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/J7PZ-input.yaml new file mode 100644 index 00000000..a28a7ac0 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/J7PZ-input.yaml @@ -0,0 +1,7 @@ +# Ordered maps are represented as +# A sequence of mappings, with +# each mapping having one key +--- !!omap +- Mark McGwire: 65 +- Sammy Sosa: 63 +- Ken Griffy: 58 diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/J7PZ-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/J7PZ-output.yml new file mode 100644 index 00000000..53f1d1e2 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/J7PZ-output.yml @@ -0,0 +1,11 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/J7PZ-input.yaml +# Ordered maps are represented as +# A sequence of mappings, with +# each mapping having one key +--- !!omap +- + Mark McGwire: 65 +- + Sammy Sosa: 63 +- + Ken Griffy: 58 diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/JQ4R-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/JQ4R-errors.json new file mode 100644 index 00000000..d183ae3c --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/JQ4R-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 4, + "column": 3 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/JQ4R-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/JQ4R-input.yaml new file mode 100644 index 00000000..d2f2ccfb --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/JQ4R-input.yaml @@ -0,0 +1,3 @@ +block sequence: + - one + - two : three diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/JQ4R-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/JQ4R-output.yml new file mode 100644 index 00000000..df28dd8d --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/JQ4R-output.yml @@ -0,0 +1,5 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/JQ4R-input.yaml +block sequence: + - one + - + two : three diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZP5-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZP5-errors.json new file mode 100644 index 00000000..139f0c53 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZP5-errors.json @@ -0,0 +1,12 @@ +[ + { + "message": "Unexpected line break after this `-` indicator.", + "line": 11, + "column": 2 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 14, + "column": 2 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZP5-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZP5-input.yaml new file mode 100644 index 00000000..a18e3459 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZP5-input.yaml @@ -0,0 +1,15 @@ +a: "double + quotes" # lala +b: plain + value # lala +c : #lala + d +? # lala + - seq1 +: # lala + - #lala + seq2 +e: &node # lala + - x: y +block: > # lala + abcde diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZP5-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZP5-output.yml new file mode 100644 index 00000000..3be8b735 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZP5-output.yml @@ -0,0 +1,16 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZP5-input.yaml +a: "double + quotes" # lala +b: plain + value # lala +c : #lala + d +? # lala + - seq1 +: # lala + - seq2 +e: &node # lala + - + x: y +block: > # lala + abcde diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZT7-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZT7-errors.json new file mode 100644 index 00000000..3c777a16 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZT7-errors.json @@ -0,0 +1,12 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 20, + "column": 3 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 24, + "column": 3 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZT7-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZT7-input.yaml new file mode 100644 index 00000000..a5c8dc85 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZT7-input.yaml @@ -0,0 +1,26 @@ +--- +Time: 2001-11-23 15:01:42 -5 +User: ed +Warning: + This is an error message + for the log file +--- +Time: 2001-11-23 15:02:31 -5 +User: ed +Warning: + A slightly different error + message. +--- +Date: 2001-11-23 15:03:17 -5 +User: ed +Fatal: + Unknown variable "bar" +Stack: + - file: TopClass.py + line: 23 + code: | + x = MoreObject("345\n") + - file: MoreClass.py + line: 58 + code: |- + foo = bar diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZT7-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZT7-output.yml new file mode 100644 index 00000000..d0ae8bce --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZT7-output.yml @@ -0,0 +1,29 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/RZT7-input.yaml +--- +Time: 2001-11-23 15:01:42 -5 +User: ed +Warning: + This is an error message + for the log file +--- +Time: 2001-11-23 15:02:31 -5 +User: ed +Warning: + A slightly different error + message. +--- +Date: 2001-11-23 15:03:17 -5 +User: ed +Fatal: + Unknown variable "bar" +Stack: + - + file: TopClass.py + line: 23 + code: | + x = MoreObject("345\n") + - + file: MoreClass.py + line: 58 + code: |- + foo = bar diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/UGM3-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/UGM3-errors.json new file mode 100644 index 00000000..9b97a2e8 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/UGM3-errors.json @@ -0,0 +1,12 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 17, + "column": 5 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 21, + "column": 5 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/UGM3-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/UGM3-input.yaml new file mode 100644 index 00000000..4625739d --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/UGM3-input.yaml @@ -0,0 +1,29 @@ +--- ! +invoice: 34843 +date : 2001-01-23 +bill-to: &id001 + given : Chris + family : Dumars + address: + lines: | + 458 Walkman Dr. + Suite #292 + city : Royal Oak + state : MI + postal : 48046 +ship-to: *id001 +product: + - sku : BL394D + quantity : 4 + description : Basketball + price : 450.00 + - sku : BL4438H + quantity : 1 + description : Super Hoop + price : 2392.00 +tax : 251.42 +total: 4443.52 +comments: + Late afternoon is best. + Backup contact is Nancy + Billsmer @ 338-4338. diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/UGM3-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/UGM3-output.yml new file mode 100644 index 00000000..c1a0acca --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/UGM3-output.yml @@ -0,0 +1,32 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/UGM3-input.yaml +--- ! +invoice: 34843 +date : 2001-01-23 +bill-to: &id001 + given : Chris + family : Dumars + address: + lines: | + 458 Walkman Dr. + Suite #292 + city : Royal Oak + state : MI + postal : 48046 +ship-to: *id001 +product: + - + sku : BL394D + quantity : 4 + description : Basketball + price : 450.00 + - + sku : BL4438H + quantity : 1 + description : Super Hoop + price : 2392.00 +tax : 251.42 +total: 4443.52 +comments: + Late afternoon is best. + Backup contact is Nancy + Billsmer @ 338-4338. diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/V9D5-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/V9D5-errors.json new file mode 100644 index 00000000..0f44ed0b --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/V9D5-errors.json @@ -0,0 +1,12 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 2, + "column": 1 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 3, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/V9D5-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/V9D5-input.yaml new file mode 100644 index 00000000..d675cfd6 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/V9D5-input.yaml @@ -0,0 +1,3 @@ +- sun: yellow +- ? earth: blue + : moon: white diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/V9D5-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/V9D5-output.yml new file mode 100644 index 00000000..05fc9784 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/V9D5-output.yml @@ -0,0 +1,6 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/V9D5-input.yaml +- + sun: yellow +- + ? earth: blue + : moon: white diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/W42U-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/W42U-errors.json new file mode 100644 index 00000000..6a824f98 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/W42U-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 7, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/W42U-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/W42U-input.yaml new file mode 100644 index 00000000..35ac9236 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/W42U-input.yaml @@ -0,0 +1,6 @@ +- # Empty +- | + block node +- - one # Compact + - two # sequence +- one: two # Compact mapping diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/W42U-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/W42U-output.yml new file mode 100644 index 00000000..db168053 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/W42U-output.yml @@ -0,0 +1,8 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/W42U-input.yaml +- # Empty +- | + block node +- - one # Compact + - two # sequence +- + one: two # Compact mapping diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/XW4D-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/XW4D-errors.json new file mode 100644 index 00000000..a58b24fe --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/XW4D-errors.json @@ -0,0 +1,12 @@ +[ + { + "message": "Unexpected line break after this `-` indicator.", + "line": 11, + "column": 2 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 15, + "column": 2 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/XW4D-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/XW4D-input.yaml new file mode 100644 index 00000000..4fcc93e7 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/XW4D-input.yaml @@ -0,0 +1,16 @@ +a: "double + quotes" # lala +b: plain + value # lala +c : #lala + d +? # lala + - seq1 +: # lala + - #lala + seq2 +e: + &node # lala + - x: y +block: > # lala + abcde diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/XW4D-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/XW4D-output.yml new file mode 100644 index 00000000..56eb13e2 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/XW4D-output.yml @@ -0,0 +1,17 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/XW4D-input.yaml +a: "double + quotes" # lala +b: plain + value # lala +c : #lala + d +? # lala + - seq1 +: # lala + - seq2 +e: + &node # lala + - + x: y +block: > # lala + abcde diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/_config.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/_config.json new file mode 100644 index 00000000..7d787916 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/_config.json @@ -0,0 +1,14 @@ +{ + "options": [ + "never", + { + "nestedHyphen": "never", + "blockMapping": "always" + } + ], + "settings": { + "yml": { + "indent": 8 + } + } +} diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/mapping-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/mapping-errors.json new file mode 100644 index 00000000..f8137727 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/mapping-errors.json @@ -0,0 +1,12 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 2, + "column": 1 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 3, + "column": 3 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/mapping-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/mapping-input.yaml new file mode 100644 index 00000000..d05ed3f0 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/mapping-input.yaml @@ -0,0 +1,3 @@ +- a: a +- - b: b +- {c: c} diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/mapping-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/mapping-output.yml new file mode 100644 index 00000000..e827a475 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/mapping-output.yml @@ -0,0 +1,6 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-block-mapping-only-newline/mapping-input.yaml +- + a: a +- - + b: b +- {c: c} diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-default/mapping-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-default/mapping-errors.json new file mode 100644 index 00000000..324379d7 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-default/mapping-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 3, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-default/mapping-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-default/mapping-input.yaml new file mode 100644 index 00000000..d05ed3f0 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-default/mapping-input.yaml @@ -0,0 +1,3 @@ +- a: a +- - b: b +- {c: c} diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-default/mapping-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-default/mapping-output.yml new file mode 100644 index 00000000..8e2b036c --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-default/mapping-output.yml @@ -0,0 +1,5 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-default/mapping-input.yaml +- a: a +- + - b: b +- {c: c} diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/3ALJ-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/3ALJ-errors.json new file mode 100644 index 00000000..db8ac28d --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/3ALJ-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 2, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/3ALJ-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/3ALJ-input.yaml new file mode 100644 index 00000000..4738eb10 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/3ALJ-input.yaml @@ -0,0 +1,3 @@ +- - s1_i1 + - s1_i2 +- s2 diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/3ALJ-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/3ALJ-output.yml new file mode 100644 index 00000000..130dfb32 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/3ALJ-output.yml @@ -0,0 +1,5 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/3ALJ-input.yaml +- + - s1_i1 + - s1_i2 +- s2 diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/6BCT-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/6BCT-errors.json new file mode 100644 index 00000000..0f44ed0b --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/6BCT-errors.json @@ -0,0 +1,12 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 2, + "column": 1 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 3, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/6BCT-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/6BCT-input.yaml new file mode 100644 index 00000000..5f48cf49 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/6BCT-input.yaml @@ -0,0 +1,3 @@ +- foo: bar +- - baz + - baz diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/6BCT-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/6BCT-output.yml new file mode 100644 index 00000000..1871a3d4 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/6BCT-output.yml @@ -0,0 +1,6 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/6BCT-input.yaml +- + foo: bar +- + - baz + - baz diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/735Y-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/735Y-errors.json new file mode 100644 index 00000000..a7f0e0d5 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/735Y-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Unexpected line break after this `-` indicator.", + "line": 2, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/735Y-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/735Y-input.yaml new file mode 100644 index 00000000..a3f13ae6 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/735Y-input.yaml @@ -0,0 +1,6 @@ +- + "flow in block" +- > + Block scalar +- !!map # Block collection + foo : bar diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/735Y-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/735Y-output.yml new file mode 100644 index 00000000..176b23f6 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/735Y-output.yml @@ -0,0 +1,6 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/735Y-input.yaml +- "flow in block" +- > + Block scalar +- !!map # Block collection + foo : bar diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/93JH-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/93JH-errors.json new file mode 100644 index 00000000..6985ad89 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/93JH-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 2, + "column": 2 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/93JH-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/93JH-input.yaml new file mode 100644 index 00000000..30c49a33 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/93JH-input.yaml @@ -0,0 +1,4 @@ + - key: value + key2: value2 + - + key3: value3 diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/93JH-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/93JH-output.yml new file mode 100644 index 00000000..14e0bfcc --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/93JH-output.yml @@ -0,0 +1,6 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/93JH-input.yaml + - + key: value + key2: value2 + - + key3: value3 diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/9U5K-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/9U5K-errors.json new file mode 100644 index 00000000..ec1d1210 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/9U5K-errors.json @@ -0,0 +1,17 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 4, + "column": 1 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 6, + "column": 1 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 8, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/9U5K-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/9U5K-input.yaml new file mode 100644 index 00000000..63a8ed7e --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/9U5K-input.yaml @@ -0,0 +1,8 @@ +--- +# Products purchased +- item : Super Hoop + quantity: 1 +- item : Basketball + quantity: 4 +- item : Big Shoes + quantity: 1 diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/9U5K-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/9U5K-output.yml new file mode 100644 index 00000000..f46e64da --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/9U5K-output.yml @@ -0,0 +1,12 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/9U5K-input.yaml +--- +# Products purchased +- + item : Super Hoop + quantity: 1 +- + item : Basketball + quantity: 4 +- + item : Big Shoes + quantity: 1 diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/A2M4-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/A2M4-errors.json new file mode 100644 index 00000000..d183ae3c --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/A2M4-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 4, + "column": 3 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/A2M4-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/A2M4-input.yaml new file mode 100644 index 00000000..ac0d970d --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/A2M4-input.yaml @@ -0,0 +1,4 @@ +? a +: - b + - - c + - d diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/A2M4-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/A2M4-output.yml new file mode 100644 index 00000000..088642f8 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/A2M4-output.yml @@ -0,0 +1,6 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/A2M4-input.yaml +? a +: - b + - + - c + - d diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/AZW3-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/AZW3-errors.json new file mode 100644 index 00000000..0f44ed0b --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/AZW3-errors.json @@ -0,0 +1,12 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 2, + "column": 1 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 3, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/AZW3-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/AZW3-input.yaml new file mode 100644 index 00000000..c9219e95 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/AZW3-input.yaml @@ -0,0 +1,2 @@ +- bla"keks: foo +- bla]keks: foo diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/AZW3-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/AZW3-output.yml new file mode 100644 index 00000000..4a6c567c --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/AZW3-output.yml @@ -0,0 +1,5 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/AZW3-input.yaml +- + bla"keks: foo +- + bla]keks: foo diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/FH7J-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/FH7J-errors.json new file mode 100644 index 00000000..2198c57b --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/FH7J-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 6, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/FH7J-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/FH7J-input.yaml new file mode 100644 index 00000000..2b07b28b --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/FH7J-input.yaml @@ -0,0 +1,5 @@ +- !!str +- + !!null : a + b: !!str +- !!str : !!null diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/FH7J-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/FH7J-output.yml new file mode 100644 index 00000000..ea0b25fc --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/FH7J-output.yml @@ -0,0 +1,7 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/FH7J-input.yaml +- !!str +- + !!null : a + b: !!str +- + !!str : !!null diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/J7PZ-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/J7PZ-errors.json new file mode 100644 index 00000000..b39e2c24 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/J7PZ-errors.json @@ -0,0 +1,17 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 6, + "column": 1 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 7, + "column": 1 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 8, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/J7PZ-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/J7PZ-input.yaml new file mode 100644 index 00000000..a28a7ac0 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/J7PZ-input.yaml @@ -0,0 +1,7 @@ +# Ordered maps are represented as +# A sequence of mappings, with +# each mapping having one key +--- !!omap +- Mark McGwire: 65 +- Sammy Sosa: 63 +- Ken Griffy: 58 diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/J7PZ-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/J7PZ-output.yml new file mode 100644 index 00000000..6ae8ef9b --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/J7PZ-output.yml @@ -0,0 +1,11 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/J7PZ-input.yaml +# Ordered maps are represented as +# A sequence of mappings, with +# each mapping having one key +--- !!omap +- + Mark McGwire: 65 +- + Sammy Sosa: 63 +- + Ken Griffy: 58 diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/JQ4R-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/JQ4R-errors.json new file mode 100644 index 00000000..d183ae3c --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/JQ4R-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 4, + "column": 3 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/JQ4R-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/JQ4R-input.yaml new file mode 100644 index 00000000..d2f2ccfb --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/JQ4R-input.yaml @@ -0,0 +1,3 @@ +block sequence: + - one + - two : three diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/JQ4R-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/JQ4R-output.yml new file mode 100644 index 00000000..9ae80c90 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/JQ4R-output.yml @@ -0,0 +1,5 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/JQ4R-input.yaml +block sequence: + - one + - + two : three diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZP5-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZP5-errors.json new file mode 100644 index 00000000..139f0c53 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZP5-errors.json @@ -0,0 +1,12 @@ +[ + { + "message": "Unexpected line break after this `-` indicator.", + "line": 11, + "column": 2 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 14, + "column": 2 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZP5-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZP5-input.yaml new file mode 100644 index 00000000..a18e3459 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZP5-input.yaml @@ -0,0 +1,15 @@ +a: "double + quotes" # lala +b: plain + value # lala +c : #lala + d +? # lala + - seq1 +: # lala + - #lala + seq2 +e: &node # lala + - x: y +block: > # lala + abcde diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZP5-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZP5-output.yml new file mode 100644 index 00000000..28c4b315 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZP5-output.yml @@ -0,0 +1,16 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZP5-input.yaml +a: "double + quotes" # lala +b: plain + value # lala +c : #lala + d +? # lala + - seq1 +: # lala + - seq2 +e: &node # lala + - + x: y +block: > # lala + abcde diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZT7-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZT7-errors.json new file mode 100644 index 00000000..3c777a16 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZT7-errors.json @@ -0,0 +1,12 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 20, + "column": 3 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 24, + "column": 3 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZT7-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZT7-input.yaml new file mode 100644 index 00000000..a5c8dc85 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZT7-input.yaml @@ -0,0 +1,26 @@ +--- +Time: 2001-11-23 15:01:42 -5 +User: ed +Warning: + This is an error message + for the log file +--- +Time: 2001-11-23 15:02:31 -5 +User: ed +Warning: + A slightly different error + message. +--- +Date: 2001-11-23 15:03:17 -5 +User: ed +Fatal: + Unknown variable "bar" +Stack: + - file: TopClass.py + line: 23 + code: | + x = MoreObject("345\n") + - file: MoreClass.py + line: 58 + code: |- + foo = bar diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZT7-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZT7-output.yml new file mode 100644 index 00000000..a8fc6737 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZT7-output.yml @@ -0,0 +1,29 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/RZT7-input.yaml +--- +Time: 2001-11-23 15:01:42 -5 +User: ed +Warning: + This is an error message + for the log file +--- +Time: 2001-11-23 15:02:31 -5 +User: ed +Warning: + A slightly different error + message. +--- +Date: 2001-11-23 15:03:17 -5 +User: ed +Fatal: + Unknown variable "bar" +Stack: + - + file: TopClass.py + line: 23 + code: | + x = MoreObject("345\n") + - + file: MoreClass.py + line: 58 + code: |- + foo = bar diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/UGM3-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/UGM3-errors.json new file mode 100644 index 00000000..9b97a2e8 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/UGM3-errors.json @@ -0,0 +1,12 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 17, + "column": 5 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 21, + "column": 5 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/UGM3-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/UGM3-input.yaml new file mode 100644 index 00000000..4625739d --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/UGM3-input.yaml @@ -0,0 +1,29 @@ +--- ! +invoice: 34843 +date : 2001-01-23 +bill-to: &id001 + given : Chris + family : Dumars + address: + lines: | + 458 Walkman Dr. + Suite #292 + city : Royal Oak + state : MI + postal : 48046 +ship-to: *id001 +product: + - sku : BL394D + quantity : 4 + description : Basketball + price : 450.00 + - sku : BL4438H + quantity : 1 + description : Super Hoop + price : 2392.00 +tax : 251.42 +total: 4443.52 +comments: + Late afternoon is best. + Backup contact is Nancy + Billsmer @ 338-4338. diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/UGM3-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/UGM3-output.yml new file mode 100644 index 00000000..ff3a4464 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/UGM3-output.yml @@ -0,0 +1,32 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/UGM3-input.yaml +--- ! +invoice: 34843 +date : 2001-01-23 +bill-to: &id001 + given : Chris + family : Dumars + address: + lines: | + 458 Walkman Dr. + Suite #292 + city : Royal Oak + state : MI + postal : 48046 +ship-to: *id001 +product: + - + sku : BL394D + quantity : 4 + description : Basketball + price : 450.00 + - + sku : BL4438H + quantity : 1 + description : Super Hoop + price : 2392.00 +tax : 251.42 +total: 4443.52 +comments: + Late afternoon is best. + Backup contact is Nancy + Billsmer @ 338-4338. diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/V9D5-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/V9D5-errors.json new file mode 100644 index 00000000..0f44ed0b --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/V9D5-errors.json @@ -0,0 +1,12 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 2, + "column": 1 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 3, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/V9D5-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/V9D5-input.yaml new file mode 100644 index 00000000..d675cfd6 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/V9D5-input.yaml @@ -0,0 +1,3 @@ +- sun: yellow +- ? earth: blue + : moon: white diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/V9D5-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/V9D5-output.yml new file mode 100644 index 00000000..9cb9d008 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/V9D5-output.yml @@ -0,0 +1,6 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/V9D5-input.yaml +- + sun: yellow +- + ? earth: blue + : moon: white diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/W42U-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/W42U-errors.json new file mode 100644 index 00000000..6680cd4a --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/W42U-errors.json @@ -0,0 +1,12 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 5, + "column": 1 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 7, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/W42U-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/W42U-input.yaml new file mode 100644 index 00000000..35ac9236 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/W42U-input.yaml @@ -0,0 +1,6 @@ +- # Empty +- | + block node +- - one # Compact + - two # sequence +- one: two # Compact mapping diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/W42U-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/W42U-output.yml new file mode 100644 index 00000000..ede8e605 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/W42U-output.yml @@ -0,0 +1,9 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/W42U-input.yaml +- # Empty +- | + block node +- + - one # Compact + - two # sequence +- + one: two # Compact mapping diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/XW4D-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/XW4D-errors.json new file mode 100644 index 00000000..a58b24fe --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/XW4D-errors.json @@ -0,0 +1,12 @@ +[ + { + "message": "Unexpected line break after this `-` indicator.", + "line": 11, + "column": 2 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 15, + "column": 2 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/XW4D-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/XW4D-input.yaml new file mode 100644 index 00000000..4fcc93e7 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/XW4D-input.yaml @@ -0,0 +1,16 @@ +a: "double + quotes" # lala +b: plain + value # lala +c : #lala + d +? # lala + - seq1 +: # lala + - #lala + seq2 +e: + &node # lala + - x: y +block: > # lala + abcde diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/XW4D-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/XW4D-output.yml new file mode 100644 index 00000000..dc98e8e0 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/XW4D-output.yml @@ -0,0 +1,17 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/XW4D-input.yaml +a: "double + quotes" # lala +b: plain + value # lala +c : #lala + d +? # lala + - seq1 +: # lala + - seq2 +e: + &node # lala + - + x: y +block: > # lala + abcde diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/_config.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/_config.json new file mode 100644 index 00000000..dec210f9 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/_config.json @@ -0,0 +1,14 @@ +{ + "options": [ + "never", + { + "nestedHyphen": "always", + "blockMapping": "always" + } + ], + "settings": { + "yml": { + "indent": 8 + } + } +} diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/mapping-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/mapping-errors.json new file mode 100644 index 00000000..77612266 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/mapping-errors.json @@ -0,0 +1,17 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 2, + "column": 1 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 3, + "column": 1 + }, + { + "message": "Expected a line break after this `-` indicator.", + "line": 3, + "column": 3 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/mapping-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/mapping-input.yaml new file mode 100644 index 00000000..d05ed3f0 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/mapping-input.yaml @@ -0,0 +1,3 @@ +- a: a +- - b: b +- {c: c} diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/mapping-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/mapping-output.yml new file mode 100644 index 00000000..14f4aba5 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/mapping-output.yml @@ -0,0 +1,7 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-and-block-mapping-newline/mapping-input.yaml +- + a: a +- + - + b: b +- {c: c} diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/229Q-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/229Q-errors.json new file mode 100644 index 00000000..703a929f --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/229Q-errors.json @@ -0,0 +1,12 @@ +[ + { + "message": "Unexpected line break after this `-` indicator.", + "line": 2, + "column": 1 + }, + { + "message": "Unexpected line break after this `-` indicator.", + "line": 6, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/229Q-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/229Q-input.yaml new file mode 100644 index 00000000..430f6b3d --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/229Q-input.yaml @@ -0,0 +1,8 @@ +- + name: Mark McGwire + hr: 65 + avg: 0.278 +- + name: Sammy Sosa + hr: 63 + avg: 0.288 diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/229Q-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/229Q-output.yml new file mode 100644 index 00000000..f32f6d3a --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/229Q-output.yml @@ -0,0 +1,7 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/229Q-input.yaml +- name: Mark McGwire + hr: 65 + avg: 0.278 +- name: Sammy Sosa + hr: 63 + avg: 0.288 diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/3ALJ-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/3ALJ-errors.json new file mode 100644 index 00000000..db8ac28d --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/3ALJ-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 2, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/3ALJ-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/3ALJ-input.yaml new file mode 100644 index 00000000..4738eb10 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/3ALJ-input.yaml @@ -0,0 +1,3 @@ +- - s1_i1 + - s1_i2 +- s2 diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/3ALJ-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/3ALJ-output.yml new file mode 100644 index 00000000..0c7e7bcb --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/3ALJ-output.yml @@ -0,0 +1,5 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/3ALJ-input.yaml +- + - s1_i1 + - s1_i2 +- s2 diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/6BCT-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/6BCT-errors.json new file mode 100644 index 00000000..324379d7 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/6BCT-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 3, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/6BCT-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/6BCT-input.yaml new file mode 100644 index 00000000..5f48cf49 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/6BCT-input.yaml @@ -0,0 +1,3 @@ +- foo: bar +- - baz + - baz diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/6BCT-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/6BCT-output.yml new file mode 100644 index 00000000..f077e6b7 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/6BCT-output.yml @@ -0,0 +1,5 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/6BCT-input.yaml +- foo: bar +- + - baz + - baz diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/735Y-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/735Y-errors.json new file mode 100644 index 00000000..a7f0e0d5 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/735Y-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Unexpected line break after this `-` indicator.", + "line": 2, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/735Y-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/735Y-input.yaml new file mode 100644 index 00000000..a3f13ae6 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/735Y-input.yaml @@ -0,0 +1,6 @@ +- + "flow in block" +- > + Block scalar +- !!map # Block collection + foo : bar diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/735Y-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/735Y-output.yml new file mode 100644 index 00000000..1608a9d5 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/735Y-output.yml @@ -0,0 +1,6 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/735Y-input.yaml +- "flow in block" +- > + Block scalar +- !!map # Block collection + foo : bar diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/93JH-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/93JH-errors.json new file mode 100644 index 00000000..4f78f755 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/93JH-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Unexpected line break after this `-` indicator.", + "line": 4, + "column": 2 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/93JH-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/93JH-input.yaml new file mode 100644 index 00000000..30c49a33 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/93JH-input.yaml @@ -0,0 +1,4 @@ + - key: value + key2: value2 + - + key3: value3 diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/93JH-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/93JH-output.yml new file mode 100644 index 00000000..ba2dadc2 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/93JH-output.yml @@ -0,0 +1,4 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/93JH-input.yaml + - key: value + key2: value2 + - key3: value3 diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/A2M4-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/A2M4-errors.json new file mode 100644 index 00000000..d183ae3c --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/A2M4-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 4, + "column": 3 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/A2M4-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/A2M4-input.yaml new file mode 100644 index 00000000..ac0d970d --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/A2M4-input.yaml @@ -0,0 +1,4 @@ +? a +: - b + - - c + - d diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/A2M4-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/A2M4-output.yml new file mode 100644 index 00000000..7ac2521f --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/A2M4-output.yml @@ -0,0 +1,6 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/A2M4-input.yaml +? a +: - b + - + - c + - d diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/FH7J-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/FH7J-errors.json new file mode 100644 index 00000000..47e5a5bf --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/FH7J-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Unexpected line break after this `-` indicator.", + "line": 3, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/FH7J-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/FH7J-input.yaml new file mode 100644 index 00000000..2b07b28b --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/FH7J-input.yaml @@ -0,0 +1,5 @@ +- !!str +- + !!null : a + b: !!str +- !!str : !!null diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/FH7J-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/FH7J-output.yml new file mode 100644 index 00000000..617fc206 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/FH7J-output.yml @@ -0,0 +1,5 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/FH7J-input.yaml +- !!str +- !!null : a + b: !!str +- !!str : !!null diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/RZP5-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/RZP5-errors.json new file mode 100644 index 00000000..47ba2762 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/RZP5-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Unexpected line break after this `-` indicator.", + "line": 11, + "column": 2 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/RZP5-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/RZP5-input.yaml new file mode 100644 index 00000000..a18e3459 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/RZP5-input.yaml @@ -0,0 +1,15 @@ +a: "double + quotes" # lala +b: plain + value # lala +c : #lala + d +? # lala + - seq1 +: # lala + - #lala + seq2 +e: &node # lala + - x: y +block: > # lala + abcde diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/RZP5-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/RZP5-output.yml new file mode 100644 index 00000000..e7d34fb1 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/RZP5-output.yml @@ -0,0 +1,15 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/RZP5-input.yaml +a: "double + quotes" # lala +b: plain + value # lala +c : #lala + d +? # lala + - seq1 +: # lala + - seq2 +e: &node # lala + - x: y +block: > # lala + abcde diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/W42U-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/W42U-errors.json new file mode 100644 index 00000000..f730dbe9 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/W42U-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 5, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/W42U-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/W42U-input.yaml new file mode 100644 index 00000000..35ac9236 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/W42U-input.yaml @@ -0,0 +1,6 @@ +- # Empty +- | + block node +- - one # Compact + - two # sequence +- one: two # Compact mapping diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/W42U-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/W42U-output.yml new file mode 100644 index 00000000..72636b99 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/W42U-output.yml @@ -0,0 +1,8 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/W42U-input.yaml +- # Empty +- | + block node +- + - one # Compact + - two # sequence +- one: two # Compact mapping diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/XW4D-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/XW4D-errors.json new file mode 100644 index 00000000..47ba2762 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/XW4D-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Unexpected line break after this `-` indicator.", + "line": 11, + "column": 2 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/XW4D-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/XW4D-input.yaml new file mode 100644 index 00000000..4fcc93e7 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/XW4D-input.yaml @@ -0,0 +1,16 @@ +a: "double + quotes" # lala +b: plain + value # lala +c : #lala + d +? # lala + - seq1 +: # lala + - #lala + seq2 +e: + &node # lala + - x: y +block: > # lala + abcde diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/XW4D-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/XW4D-output.yml new file mode 100644 index 00000000..593fff0b --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/XW4D-output.yml @@ -0,0 +1,16 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/XW4D-input.yaml +a: "double + quotes" # lala +b: plain + value # lala +c : #lala + d +? # lala + - seq1 +: # lala + - seq2 +e: + &node # lala + - x: y +block: > # lala + abcde diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/_config.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/_config.json new file mode 100644 index 00000000..ede7695a --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/_config.json @@ -0,0 +1,14 @@ +{ + "options": [ + "never", + { + "nestedHyphen": "always", + "blockMapping": "never" + } + ], + "settings": { + "yml": { + "indent": 8 + } + } +} diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/mapping-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/mapping-errors.json new file mode 100644 index 00000000..324379d7 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/mapping-errors.json @@ -0,0 +1,7 @@ +[ + { + "message": "Expected a line break after this `-` indicator.", + "line": 3, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/mapping-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/mapping-input.yaml new file mode 100644 index 00000000..d05ed3f0 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/mapping-input.yaml @@ -0,0 +1,3 @@ +- a: a +- - b: b +- {c: c} diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/mapping-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/mapping-output.yml new file mode 100644 index 00000000..5c5e294c --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/mapping-output.yml @@ -0,0 +1,5 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-nested-hyphen-only-newline/mapping-input.yaml +- a: a +- + - b: b +- {c: c} diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-never/_config.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-never/_config.json index 7bf461c4..f8959d58 100644 --- a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-never/_config.json +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-never/_config.json @@ -2,7 +2,8 @@ "options": [ "never", { - "nestedHyphen": "never" + "nestedHyphen": "never", + "blockMapping": "never" } ], "settings": { diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-never/mapping-errors.json b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-never/mapping-errors.json new file mode 100644 index 00000000..211d9180 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-never/mapping-errors.json @@ -0,0 +1,17 @@ +[ + { + "message": "Unexpected line break after this `-` indicator.", + "line": 2, + "column": 1 + }, + { + "message": "Unexpected line break after this `-` indicator.", + "line": 4, + "column": 3 + }, + { + "message": "Unexpected line break after this `-` indicator.", + "line": 6, + "column": 1 + } +] diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-never/mapping-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-never/mapping-input.yaml new file mode 100644 index 00000000..f99b825d --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-never/mapping-input.yaml @@ -0,0 +1,6 @@ +- + a: a +- - + b: b +- + {c: c} diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-never/mapping-output.yml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-never/mapping-output.yml new file mode 100644 index 00000000..3875be45 --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-never/mapping-output.yml @@ -0,0 +1,4 @@ +# block-sequence-hyphen-indicator-newline/invalid/yaml-test-suite-for-never/mapping-input.yaml +- a: a +- - b: b +- {c: c} diff --git a/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/valid/mapping-input.yaml b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/valid/mapping-input.yaml new file mode 100644 index 00000000..504050de --- /dev/null +++ b/tests/fixtures/rules/block-sequence-hyphen-indicator-newline/valid/mapping-input.yaml @@ -0,0 +1,7 @@ +# {"options": ["never", {"nestedHyphen": "never", "blockMapping": "always" }]} +- + a: a +- - + b: b +# flow style mapping don't format +- {c: c} diff --git a/tools/update-fixtures.ts b/tools/update-fixtures.ts index 90204325..f22eefae 100644 --- a/tools/update-fixtures.ts +++ b/tools/update-fixtures.ts @@ -168,8 +168,20 @@ makeSuiteTests( "block-sequence-hyphen-indicator-newline", { default: [], - never: ["never", { nestedHyphen: "never" }], - always: ["always", { nestedHyphen: "always" }], + never: ["never", { nestedHyphen: "never", blockMapping: "never" }], + always: ["always", { nestedHyphen: "always", blockMapping: "always" }], + "nested-hyphen-only-newline": [ + "never", + { nestedHyphen: "always", blockMapping: "never" }, + ], + "block-mapping-only-newline": [ + "never", + { nestedHyphen: "never", blockMapping: "always" }, + ], + "nested-hyphen-and-block-mapping-newline": [ + "never", + { nestedHyphen: "always", blockMapping: "always" }, + ], }, { force: true }, );