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

gherkin/python: Support gherkin markdown #2103

Merged
merged 29 commits into from
Nov 8, 2022

Conversation

temyers
Copy link
Contributor

@temyers temyers commented Oct 24, 2022

Summary

Ports the Javascript implementation of Gherkin Markdown support to Python.

Details

This implementation ports the specifications and implementation from the Javascript for a (hopefully) like-for-like implementation.

Motivation and Context

Markdown provides a much richer living documentation format over classic Gherkin syntax

Relates to: 1979

How Has This Been Tested?

Unit tests have been ported from the Javascript version.
Additional unit tests have been added for improved coverage.
A few additional changes have been made without unit test coverage in order to ensure parity with the Javascript version.
I presume these are covered under acceptance tests?

Tested using pytest unit tests only at this stage.

Testing Environment: python-3.10 container.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

Checklist:

  • The change has been ported to Java.
  • The change has been ported to Ruby.
  • The change has been ported to JavaScript.
  • The change has been ported to Go.
  • The change has been ported to .NET.
  • I've added tests for my code.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have updated the CHANGELOG accordingly.

@temyers
Copy link
Contributor Author

temyers commented Nov 7, 2022

As an aside, it's great to see how clean the codebase is. Very accessible for new contributors.

I was able to port the markdown implementation with no prior experience of the codebase based purely on the Typescript implementation and tests.

.vscode/settings.json Outdated Show resolved Hide resolved
Copy link
Contributor

@mpkorstanje mpkorstanje left a comment

Choose a reason for hiding this comment

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

It looks like the acceptance tests were not updated to include Markdown. For example see:

GOOD_FEATURE_FILES = $(shell find ../testdata/good -name "*.feature" -o -name "*.feature.md")
BAD_FEATURE_FILES = $(shell find ../testdata/bad -name "*.feature" -o -name "*.feature.md")

@mpkorstanje
Copy link
Contributor

@temyers I'm currently working on extracting Gherkin from the mono repo into its own repo. This means that this MR will soon be aimed at the wrong repository. Unfortunately this migration is fairly complex and I'm not in a position where I can to wait for you to finish this MR (I won't have sufficient time available).

So I reckon the best course of action would be to clone temyers/common and then use git-filter-repo to filter out all changes except those to the gherkin directory. Then you can make a patch of your changes and apply it to a clone of cucumber/gherkin.

The migration notes might be helpful for some more details cucumber/gherkin#2

@temyers
Copy link
Contributor Author

temyers commented Nov 8, 2022

@mpkorstanje - Updates made as per comments. I've updated the acceptance tests to include the features.

Can this make the cut? I note you said 'soon' ;)

Otherwise I'll create a new PR

@mpkorstanje mpkorstanje changed the title gherkin/python: Feature/gherkin markdown py gherkin/python: Support gherkin markdown Nov 8, 2022
@mpkorstanje mpkorstanje merged commit ec9a174 into cucumber:main Nov 8, 2022
@aslakhellesoy
Copy link
Contributor

Hi @temyers,

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

@mpkorstanje
Copy link
Contributor

Cheers, looks good enough. I reckon any problems can be fixed in future iterations.

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

Successfully merging this pull request may close these issues.

3 participants