Skip to content

A bit of general feedback #8

Open
@bbatsov

Description

@bbatsov

I've been going over the code here because of rubocop/rubocop#13792, and while it's pretty simple overall I'm wondering about a couple of things:

  • Why have separate About, Rules and Context classes? To me it seems that something like a single plugin Manifest (or whatever will be enough) I also find the names Rules and Context to be somewhat confusing, as I'm having a hard-time mapping them to what they actually carry in terms of information. I'm guessing at version 1.0+ you might not be willing to restructure those, but at least they can get more documentation as now it's just a listing of example values from which one has to infer the purpose of each class. (and the example in the README)
  • Does the concept of "homepage" make sense in the About class? If something is a gem it already has it, and if it's not - it's like the same repo. In general the whole About concept seems a bit redundant to me, when dealing with gems, but I assume it exists mostly for the case when you don't.

In this example:

# `context' is an instance of LintRoller::Context provided by the runner
    def rules(context)
      LintRoller::Rules.new(
        type: :path,
        config_format: :rubocop,
        value: Pathname.new(__dir__).join("../../config/default.yml")
      )

It'd be nice if something was actually extracted from the context, so it's clearer why it's passed there at all. Also this example really made me question the choice of the name Rules. :-)

  • What's the purpose of the user configuration that can be passed the plugins? If the plugins have some internal configuration format related to their runners it's not very obvious what the additional configuration should be used for. I'm guessing some general flexibility is not a bad idea in the general, but I'm struggling to come up with the use-cases for this off the top of my head.

Anyways, this is the type of discussion that I'd love to have had while the API was being designed. I don't see any fundamental issues and I like the overall idea is fine, but it would have been nice to be able to provide some input before the API was finalized if you expected RuboCop to adopt it.

//cc @koic @dvandersluis

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions