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

Allow to exclude single checks from a configurable rule #70

Open
1 of 3 tasks
nils-christian opened this issue Mar 6, 2024 · 0 comments
Open
1 of 3 tasks

Allow to exclude single checks from a configurable rule #70

nils-christian opened this issue Mar 6, 2024 · 0 comments

Comments

@nils-christian
Copy link

nils-christian commented Mar 6, 2024

Summary

Hi,

We would like to suggest a feature allowing us to exclude certain rules from a configured rule "package".

Type of Issue

It is a :

  • bug
  • request
  • question regarding the documentation

Motivation

We enforce certain architecture rules across various projects. Those are part of a platform used by said projects. Those rules are static fields contained in a single class so that we only have to include a single rule.

configurableRules>
  <configurableRule>
    <rule>our.custom.Rules</rule>
  </configurableRule>
</configurableRules>

This is working for 90% of our use cases. However, we have some projects that are doing things slightly different and need to exclude some of those rules. Let's assume that we have rules A, B and C and only C should not be applied. The projects in question can now configure those checks explicitly:

configurableRules>
  <configurableRule>
    <rule>our.custom.Rules</rule>
    <checks>
      <check>A</check>
      <check>B</check>
    </checks>
  </configurableRule>
</configurableRules>

This has two disadvantages:

  1. We have something like 20 rules, so the projects have to declare 19 of them just to exclude a single one.
  2. New rules, which are added to our.custom.Rules can easily be forgotten by the projects during an update of our platform.

Thus we would like to exclude certain checks from the rule set, like a negation of the check property.

configurableRules>
  <configurableRule>
    <rule>our.custom.Rules</rule>
    <excludedChecks>
      <excludedCheck>C</excludedCheck>
    </excludedChecks>
  </configurableRule>
</configurableRules>

Current Behavior

Either the whole rule set is executed or the given checks.

Expected Behavior

It should be possible to exclude single checks from the rule set.

Thank you and best regards

Nils

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

No branches or pull requests

1 participant