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

refactor(yaml): remove tag property #5689

Merged
merged 14 commits into from
Aug 20, 2024

Conversation

timreichen
Copy link
Contributor

@timreichen timreichen commented Aug 16, 2024

Changes
This PR removes the tag property in DumperState.

Reasoning
tag is only used in writeBlockMapping(), so it can be passed as an argument instead.

Copy link

codecov bot commented Aug 16, 2024

Codecov Report

Attention: Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 96.28%. Comparing base (8cb8496) to head (de09e54).
Report is 1 commits behind head on main.

Files Patch % Lines
yaml/_dumper_state.ts 86.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5689      +/-   ##
==========================================
- Coverage   96.28%   96.28%   -0.01%     
==========================================
  Files         474      474              
  Lines       38392    38381      -11     
  Branches     5576     5576              
==========================================
- Hits        36967    36956      -11     
  Misses       1383     1383              
  Partials       42       42              

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

@timreichen timreichen changed the title refactor(yaml): remove tag property refactor(yaml): remove tag property Aug 16, 2024
Copy link
Contributor

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

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

Can you please only include changes that directly pertain to removing the tag property? We can handle any other refactors in a separate PR.

@timreichen
Copy link
Contributor Author

Can you please only include changes that directly pertain to removing the tag property? We can handle any other refactors in a separate PR.

Alright, I undo the detectType changes

this.dump = _result || "{}"; // Empty mapping if no valid pairs.
}

detectType(explicit: boolean): boolean {
detectType(explicit: boolean) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The return type for this method has changed from explicitly boolean to now being implicitly string | null. Why? Return types should be explicit and not change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the tag property is removed and was set inside this function, it has to be returned instead. It returns string(former true) and null (former false).

yaml/_dumper_state.ts Outdated Show resolved Hide resolved
timreichen and others added 2 commits August 20, 2024 08:04
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
Copy link
Contributor

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you.

@iuioiua iuioiua enabled auto-merge (squash) August 20, 2024 06:06
@iuioiua iuioiua merged commit 9ed80af into denoland:main Aug 20, 2024
16 checks passed
@timreichen timreichen deleted the yaml-remove-tag-property branch August 24, 2024 07:55
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