Skip to content

Commit

Permalink
feat(reporter/dot): only considers rule severity for coloring invalid…
Browse files Browse the repository at this point in the history
… modules/ dependencies (#869)

## Description, Motivation and Context

- _only_ color modules & dependencies in one of the severity level
colors when there's a severity set on the associated rule

The default `dot` configuration built into dependency-cruiser made that
things that were invalid, but for which the rule was _ignored_ showed up
with a red color. This is obviously not helpful (why otherwise ignore
the rule).

## How Has This Been Tested?

- [x] green ci
- [x] adjusted automated non-regression tests

## Types of changes

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Documentation only change
- [ ] Refactor (non-breaking change which fixes an issue without
changing functionality)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
  • Loading branch information
sverweij committed Nov 18, 2023
1 parent aca6489 commit dfdb385
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
12 changes: 0 additions & 12 deletions src/report/dot/default-theme.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,6 @@ export default {
criteria: { "rules[0].severity": "info" },
attributes: { fontcolor: "blue", color: "blue" },
},
{
criteria: { valid: false },
attributes: { fontcolor: "red", color: "red" },
},
{
criteria: { couldNotResolve: true },
attributes: { color: "red", fontcolor: "red" },
},
{
criteria: { coreModule: true },
attributes: { color: "grey", fontcolor: "grey" },
Expand Down Expand Up @@ -131,10 +123,6 @@ export default {
criteria: { dynamic: true },
attributes: { style: "dashed" },
},
{
criteria: { valid: false },
attributes: { fontcolor: "red", color: "red" },
},
{
criteria: { circular: true },
attributes: { arrowhead: "normalnoneodot" },
Expand Down
2 changes: 1 addition & 1 deletion test/report/dot/theming.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe("[U] report/dot/theming - determineModuleColors - default theme", () =>
{ couldNotResolve: true },
theming.normalizeTheme({}).modules,
),
{ color: "red", fontcolor: "red" },
{},
);
});

Expand Down

0 comments on commit dfdb385

Please sign in to comment.