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

yamlfmt conflicts with yamllint if there is a long URL #49

Closed
poparotsy opened this issue May 4, 2023 · 4 comments
Closed

yamlfmt conflicts with yamllint if there is a long URL #49

poparotsy opened this issue May 4, 2023 · 4 comments
Labels
duplicate This issue or pull request already exists

Comments

@poparotsy
Copy link

  • yamllint recommends breaking long URL [more than 80 characters] into a new line.
  • yamlfmt removes the new line and put the URL back in one line.

yamllint
error line too long (86 > 80 characters) (line-length)

yamlfmt
Format YAML files........................................................Failed

  • hook id: yamlfmt
  • files were modified by this hook
@jumanjiman
Copy link
Member

👁️

@jumanjiman
Copy link
Member

i'm pretty sure this is the culprit:

from https://sourceforge.net/p/ruamel-yaml/code/ci/0.17.22/tree/CHANGES

plain scalars: put single words longer than width on a line of their own, instead
of after the previous line (issue 427, reported by Antoine Cotten <https://sourceforge.net/u/antoineco/profile/>_). Caveat: this currently results in a
space ending the previous line.

temp workaround: additional_dependencies: [ruamel.yaml==0.17.21]

@jumanjiman jumanjiman added the duplicate This issue or pull request already exists label May 4, 2023
@jumanjiman
Copy link
Member

closing this in favor of #47

jumanjiman added a commit to jumanjiman/pre-commit-hook-yamlfmt that referenced this issue May 4, 2023
From https://sourceforge.net/p/ruamel-yaml/code/ci/0.17.22/tree/CHANGES

> plain scalars: put single words longer than width on a line of their own,
> instead of after the previous line (issue 427, reported by Antoine Cotten).
> Caveat: this currently results in a space ending the previous line.

One of the side effects is that yamlfmt and yamllint become in conflict
when using ruamel.yaml 0.17.22.

Therefore constrain ruamel.yaml to be <= 0.17.21.

Resolves jumanjihouse#47

Related: jumanjihouse#49

Maybe related: jumanjihouse#48
jumanjiman added a commit to jumanjiman/pre-commit-hook-yamlfmt that referenced this issue May 4, 2023
From https://sourceforge.net/p/ruamel-yaml/code/ci/0.17.22/tree/CHANGES

> plain scalars: put single words longer than width on a line of their own,
> instead of after the previous line (issue 427, reported by Antoine Cotten).
> Caveat: this currently results in a space ending the previous line.

One of the side effects is that yamlfmt and yamllint become in conflict
when using ruamel.yaml 0.17.22.

Therefore constrain ruamel.yaml to be <= 0.17.21.

Resolves jumanjihouse#47

Related: jumanjihouse#49

Maybe related: jumanjihouse#48
@jumanjiman
Copy link
Member

published new tag 0.2.3 to constrain ruamel.yaml version:
https://github.com/jumanjihouse/pre-commit-hook-yamlfmt/releases/tag/0.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants