Skip to content

Conversation

@ldoo22
Copy link

@ldoo22 ldoo22 commented Dec 3, 2025

Closes #71

Describe the change

This PR fixes the issues described in #71:

  • Corrects invalid syntax in the README for the custom printer example.
  • Updates the write method in the abstract printer to accept two arguments, matching the way it is called internally.

Why are we doing this?

The current README example does not work as written, causing syntax and argument errors for users following it. This change ensures the example is functional and consistent with the abstract printer’s method signature.

Benefits

The documentation and example code now work correctly, making it easier for users to implement a custom printer without encountering errors.

Drawbacks

No drawbacks are expected; this PR only fixes existing issues in the documentation and method signature.

Requirements

  • Tests written & passing locally?
  • Code style checked?
  • Rebased with master branch?
  • Documentation updated?
  • Changelog updated?

EDIT

Marked “Code style checked?”.

Rubocop reports missing class documentation, which is also the case for all other printers, so this is consistent with the existing codebase.

It also warns about unused write arguments. This is expected, since the method is meant to be overridden, and the implementation of write was not changed in this PR. Keeping the current signature makes the intended usage clear to anyone reading the code. One other alternative would be prefixing each argument with an underscore, but I believe the current version is clearer.

Marking the style check as complete because the current form is, in my view, the more inline option with the rest of the project

@ldoo22 ldoo22 changed the title Bugfix/pass command to abstract printer writer Fix README custom printer example and abstract printer write method Dec 3, 2025
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.

Errors when using README example for custom printer

1 participant