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

Prevent introduction of trailing whitespace after headings with JavaScript formatter #35

Merged
merged 1 commit into from
Sep 23, 2023

Conversation

kieran-ryan
Copy link
Sponsor Member

🤔 What's changed?

With the gherkin-utils JavaScript formatter, headings will have a trailing space introduced after them. When they have a title, this is not an issue, as the space is suffixed by the title itself i.e. <heading>: <title>. However, in the absence of a title - such as the typical use case of not including a title for Examples:, the formatter introduces a trailing space at the end of the headings.

This change ensures the space is included only when there is a title.

⚡️ What's your motivation?

Prevents the introduction of unexpected artifacts into gherkin tests that use the formatter - the trailing whitespace; and fixes #34.

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

♻️ Anything particular you want feedback on?

To confirm the null check is required.

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

@kieran-ryan kieran-ryan changed the title Prevents introduction of trailing whitespaces after headings with JavaScript formatter Prevent introduction of trailing whitespaces after headings with JavaScript formatter Sep 11, 2023
@kieran-ryan kieran-ryan changed the title Prevent introduction of trailing whitespaces after headings with JavaScript formatter Prevent introduction of trailing whitespace after headings with JavaScript formatter Sep 11, 2023
@xeger
Copy link
Member

xeger commented Sep 22, 2023

This seems reasonable enough; thanks for the contribution.

CHANGELOG.md Outdated Show resolved Hide resolved
@xeger xeger merged commit f487d91 into cucumber:main Sep 23, 2023
8 checks passed
@aslakhellesoy
Copy link
Contributor

Hi @kieran-ryan,

Thanks for your making your first contribution to Cucumber, and welcome to the Cucumber committers team! You can now push directly to this repo and all other repos under the cucumber organization! 🍾

In return for this generous offer we hope you will:

  • ✅ Continue to use branches and pull requests. When someone on the core team approves a pull request (yours or someone else's), you're welcome to merge it yourself.
  • 💚 Commit to setting a good example by following and upholding our code of conduct in your interactions with other collaborators and users.
  • 💬 Join the community Slack channel to meet the rest of the team and make yourself at home.
  • ℹ️ Don't feel obliged to help, just do what you can if you have the time and the energy.
  • 🙋 Ask if you need anything. We're looking for feedback about how to make the project more welcoming, so please tell us!

On behalf of the Cucumber core team,
Aslak Hellesøy
Creator of Cucumber

@kieran-ryan kieran-ryan added the 🐛 bug Defect / Bug label Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Defect / Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Formatter introduces trailing whitespace after headings without titles
4 participants