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

Supported Hierarchical Departments #10373

Open
jaymzh opened this issue Jan 22, 2022 · 1 comment
Open

Supported Hierarchical Departments #10373

jaymzh opened this issue Jan 22, 2022 · 1 comment

Comments

@jaymzh
Copy link

jaymzh commented Jan 22, 2022

Is your feature request related to a problem? Please describe.

It would be very useful for Rubocop to be able to supported hierarchical/nested departments.

For example, if I have a department MyExtension/Foo and MyExtension/Bar it would be useful to be able to enable/disable MyExtension as a whole,

In particular this comes up with things like Cookstyle which is a tool built on top of rubocop to do Chef correctness linting. They have many departments all of the form Chef/. It would be useful to be able to turn all of those on or off.

In my particular case since for standard ruby-correctness, I tend to stick much closer to Rubocop defaults than Cookstyle defaults, but Cookstyle includes a ton of its own defaults for rubocop rules, for my cookstyle runs, I actually want to disable all rules, then enable all Chef/* rules, ala something like this:

AllCops:
  DisabledByDefault: true

Chef:
  Enabled: true

Unfortunately today I have to list every single department manually and if they add one, I have to add it to my config.

Additional context

See further discussion of this in #9752

@jaymzh
Copy link
Author

jaymzh commented Jan 22, 2022

CC @jonas054 who wanted a tag in this.

jonas054 added a commit to jonas054/rubocop that referenced this issue Feb 13, 2022
Support for top level departments is added, but there's no
support for arbitrary levels of departments at this point.
I.e., custom cops can be under various departments, which in
turn a placed under a common top level department.

After this change it's possible to, for example, disable all
cops in the cookstyle gem by adding to user configuration:

```
Chef:
  Enabled: false
```

Note! Only the `Enabled` parameter is supported. Setting other
parameters such as `Severity` on the top level (when there are
two department levels) will silently fail. No warning is shown.
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