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 StringifyOptions.noCompatMode to StringifyOptions.compatMode #5287

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.noCompatMode option has been renamed to ParseOptions.compatMode. 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.noCompatMode.

Motivation

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

Migration guide

Use ParseOptions.compatMode instead of ParseOptions.noCompatMode and swap the polarity of the option.

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

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

- parse(yamlString, { noCompatMode: false });
+ parse(yamlString, { compatMode: true });

Related

Towards #5124

@iuioiua iuioiua requested a review from kt3k as a code owner July 4, 2024 00:15
@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 (378aaa0).

Files Patch % Lines
yaml/_dumper.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5287   +/-   ##
=======================================
  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 5303767 into main Jul 4, 2024
16 checks passed
@iuioiua iuioiua deleted the yaml-StringifyOptions.compatMode branch July 4, 2024 05:07
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