Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING(yaml): rename ParseOptions.noArrayIndent to ParseOptions.arrayIndent #5286

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

iuioiua
Copy link
Contributor

@iuioiua iuioiua commented Jul 4, 2024

What's changed

The ParseOptions.noArrayIndent option has been renamed to ParseOptions.arrayIndent. As a result, the polarity of the option has been swapped. In other words, true behavior has been changed to false behavior, and visa-versa. This only affects users who currently use ParseOptions.noArrayIndent.

Motivation

This change makes the option far easier to understand by avoiding a negative-tensed name.

Migration guide

Use ParseOptions.arrayIndent instead of ParseOptions.noArrayIndent and swap the polarity of the option.

import { parse } from "@std/yaml/parse";

const yamlString = `fruits:
  - Apple
  - Banana
  - Cherry`;

- parse(yamlString, { noArrayIndent: false });
+ parse(yamlString, { arrayIndent: true });

Related

Towards #5124

@iuioiua iuioiua requested a review from kt3k as a code owner July 4, 2024 00:10
@github-actions github-actions bot added the yaml label Jul 4, 2024
Copy link

codecov bot commented Jul 4, 2024

Codecov Report

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

Project coverage is 95.71%. Comparing base (f1952ec) to head (529b8d4).

Files Patch % Lines
yaml/_dumper.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5286   +/-   ##
=======================================
  Coverage   95.71%   95.71%           
=======================================
  Files         457      457           
  Lines       37955    37955           
  Branches     5560     5560           
=======================================
  Hits        36330    36330           
  Misses       1584     1584           
  Partials       41       41           

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

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@iuioiua iuioiua merged commit 789753d into main Jul 4, 2024
19 checks passed
@iuioiua iuioiua deleted the yaml-ParseOptions.arrayIndent branch July 4, 2024 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants