standardrb / standard-sorbet

Standard Ruby Plugin providing configuration for rubocop-sorbet
MIT License
1 stars 1 forks source link

Figure out what to do with rbi.yaml #2

Open searls opened 1 year ago

searls commented 1 year ago

rubocop-sorbet ships with this config for rbi files and I'm unsure what to do about it.

We can't just merge it into the config for RBI files b/c it reconfigures a bunch of base rubocop rules (which is disallowed by Standard).

The one idea I have is for a plugin setting like this:

plugins:
  - standard-sorbet:
      ignore_unnecessary_rules_for_rbi_files: true

And then given that configuration, add in a nested ignore somehow (off the top of my head I'm not sure this would work), similar to how you can ignore rules for entire globs in standard.yml

ignore:
  - '*.rbi':
    - Layout/AlignHash
    # … etc etc

Unsure what else might make sense or be workable

maxveldink commented 1 year ago

Is there a way to "boot" Rubocop with a different configuration that only targets *.rbi files? That way, we could have two different rulesets configured and enforce a standard, non-configurable set of rules specifically for RBI files.

We normally ignore linting on RBI files in our Rubocop configs, so I admit I haven't thought too much about how they should be linted/formatted.

searls commented 1 year ago

That is possible but I'm not sure it's worth it.

I think the right solution is an ignore glob that effectively disables the same rules as that rbi config file, but a plugin can't provide that (and I'm not sure it should, since in this case we'd be disabling rules that are owned by other standard plugins). Flip side is that it'd be a lot to paste into every .standard.yml file