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

Custom formatter guide recommends use of an API marked as private #11434

Closed
sambostock opened this issue Jan 12, 2023 · 1 comment
Closed

Custom formatter guide recommends use of an API marked as private #11434

sambostock opened this issue Jan 12, 2023 · 1 comment

Comments

@sambostock
Copy link
Contributor

The custom formatter guide says to use BaseFormatter:

Creating a Custom Formatter

To implement a custom formatter, you need to subclass RuboCop::Formatter::BaseFormatter and override some methods, or implement all formatter API methods by duck typing.

Please see the documents below for more formatter API details.

However, the class is listed as private API

Class: RuboCop::Formatter::BaseFormatter Private

Overview

Warning
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Abstract base class for formatter, implements all public API methods.


Expected behavior

Either the guide should recommend another approach, or the API documentation should not describe the formatter as private.

Actual behavior

The guide and API docs conflict.

Steps to reproduce the problem

Visit current (January 12 2023) versions of links above.

RuboCop version

Not really relevant, since it's docs. Current SHAs of master branches are:

@koic koic closed this as completed in b1fb518 Jan 13, 2023
@koic
Copy link
Member

koic commented Jan 13, 2023

This is an erroneous @api private mark for RuboCop::Formatter introduced in #11294. So the guide is correct. I've fixed it by b1fb518.

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

No branches or pull requests

2 participants