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

Bump gopkg.in/yaml.v2 to v2.4.0: fixes inconsistent long lines wrapping #62

Merged
merged 1 commit into from Sep 22, 2021

Conversation

@akram
Copy link

@akram akram commented Sep 21, 2021

Fixes #54 which is required to fix other issues like:

I have added a test case and tested it with version 2.2.8 of gopkg.in which breaks with:

--- FAIL: TestJSONToYAML (0.00s)
    yaml_test.go:382: converting {"t":"a"}
    yaml_test.go:382: converting {"t":null}
    yaml_test.go:382: converting {"t":"this is very long line with spaces and it must be longer than 80 so we will repeat that it must be longer that 80"}
    yaml_test.go:390: Failed to convert JSON to YAML, input: `{"t":"this is very long line with spaces and it must be longer than 80 so we will repeat that it must be longer that 80"}`, expected `t: this is very long line with spaces and it must be longer than 80 so we will repeat that it must be longer that 80
        `, got `t: this is very long line with spaces and it must be longer than 80 so we will repeat
          that it must be longer that 80
        `
FAIL

using v2.3.0 works well:

=== RUN   TestJSONToYAML
    yaml_test.go:382: converting {"t":"a"}
    yaml_test.go:382: converting {"t":null}
    yaml_test.go:382: converting {"t":"this is very long line with spaces and it must be longer than 80 so we will repeat that it must be longer that 80"}
--- PASS: TestJSONToYAML (0.00s)
@k8s-ci-robot
Copy link

@k8s-ci-robot k8s-ci-robot commented Sep 21, 2021

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Loading

@k8s-ci-robot
Copy link

@k8s-ci-robot k8s-ci-robot commented Sep 21, 2021

Welcome @akram!

It looks like this is your first PR to kubernetes-sigs/yaml 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/yaml has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

Loading

@akram
Copy link
Author

@akram akram commented Sep 21, 2021

/assign @liggitt

Loading

go.mod Outdated Show resolved Hide resolved
Loading
@akram akram force-pushed the use-goyaml-2.3.0 branch from b043d1d to b4745b4 Sep 21, 2021
@akram akram force-pushed the use-goyaml-2.3.0 branch from b4745b4 to 22a4219 Sep 21, 2021
@akram akram changed the title Bump gopkg.in/yaml.v2 to v2.3.0: fixes inconsistent long lines wrapping Bump gopkg.in/yaml.v2 to v2.4.0: fixes inconsistent long lines wrapping Sep 21, 2021
yaml.go Outdated Show resolved Hide resolved
Loading
yaml_test.go Show resolved Hide resolved
Loading
@akram akram force-pushed the use-goyaml-2.3.0 branch from 22a4219 to 6733358 Sep 21, 2021
Calls the FutureLineWrap function to globally disable lines wrapping in unit tests.
@akram akram force-pushed the use-goyaml-2.3.0 branch from 6733358 to 131615f Sep 21, 2021
@akram akram closed this Sep 22, 2021
@akram akram deleted the use-goyaml-2.3.0 branch Sep 22, 2021
@akram akram restored the use-goyaml-2.3.0 branch Sep 22, 2021
@akram akram reopened this Sep 22, 2021
@liggitt
Copy link

@liggitt liggitt commented Sep 22, 2021

/lgtm
/approve

Loading

@k8s-ci-robot
Copy link

@k8s-ci-robot k8s-ci-robot commented Sep 22, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akram, liggitt

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Loading

@k8s-ci-robot k8s-ci-robot merged commit cea7ff5 into kubernetes-sigs:master Sep 22, 2021
2 checks passed
Loading
@@ -271,6 +271,10 @@ func TestJSONToYAML(t *testing.T) {
`{"t":null}`,
"t: null\n",
nil,
},{
Copy link

@maver1ck maver1ck Sep 22, 2021

Choose a reason for hiding this comment

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

I think this line break lint tests.
https://github.com/kubernetes-sigs/yaml/runs/3676349895

Loading

Copy link

@liggitt liggitt Sep 22, 2021

Choose a reason for hiding this comment

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

@akram can you format the files in a follow up PR?

Loading

Copy link
Author

@akram akram Sep 22, 2021

Choose a reason for hiding this comment

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

sure @liggitt

Loading

Copy link
Author

@akram akram Sep 22, 2021

Choose a reason for hiding this comment

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

here it is #63

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants