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

Add formatter plugins and start reimplementing builtins #2400

Merged
merged 5 commits into from May 4, 2024

Conversation

davidjgoss
Copy link
Contributor

@davidjgoss davidjgoss commented Apr 29, 2024

🤔 What's changed?

  • Add a new "formatter" kind of plugin (still internal)
  • Reimplement a couple of builtin formatters (html and message) as plugins and ensure they still work

The formatter plugin has a very lean interface for now - it can listen for messages, write to the output, and access the formatOptions from the configuration. The idea is to reimplement more builtin formatters and in doing so find and fill limitations, and probably also build out a useful test harness or pattern for people writing their own formatters.

Next candidates for reimplementing will be:

⚡️ What's your motivation?

Per #2091 we're working towards a plugin system, and that includes bring formatters into that with a leaner message-based interface.

🏷️ What kind of change is this?

  • 🏦 Refactoring/debt/DX (improvement to code design, tooling, etc. without changing behaviour)
  • ⚡ New feature (non-breaking change which adds new behaviour)

📋 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.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

@coveralls
Copy link

coveralls commented Apr 29, 2024

Coverage Status

coverage: 98.233% (-0.2%) from 98.402%
when pulling 8ff54d6 on feat/new-formatter-part-1
into 6dae044 on main.

await pluginManager.cleanup()
await cleanupFormatters()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cleaning up formatter streams should happen after formatter plugins have had a chance to do their own cleaning up.

@davidjgoss davidjgoss changed the title WIP: Add formatter plugins and start reimplementing builtins Add formatter plugins and start reimplementing builtins May 4, 2024
@davidjgoss davidjgoss marked this pull request as ready for review May 4, 2024 06:16
@davidjgoss davidjgoss merged commit b02a90a into main May 4, 2024
8 checks passed
@davidjgoss davidjgoss deleted the feat/new-formatter-part-1 branch May 4, 2024 06:22
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.

None yet

2 participants