sverweij / dependency-cruiser

Validate and visualize dependencies. Your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.
https://npmjs.com/dependency-cruiser
MIT License
5.27k stars 250 forks source link

fix(graph-utl): lets findRuleByName also search in 'required' rules #931

Closed sverweij closed 6 months ago

sverweij commented 6 months ago

Description

Motivation and Context

fixes #930

How Has This Been Tested?

Screenshots

With this rule added to dependency-cruiser's own config

// ...
  "required": [
    {
      "name": "something-required",
      "comment": "Foo bar baz quux garply waldo fred plugh xyzzy thud",
      "severity": "warn",
      "module": {
        "path": "^src/meta.cjs$"
      },
      "to": {
        "path": "^test/kannie"
      }
    }
  ],
// ...

... npx depcruise --progress -T err-long shows this:

  warn something-required: src/meta.cjs
    Foo bar baz quux garply waldo fred plugh xyzzy thud

✘ 1 dependency violations (0 errors, 1 warnings). 545 modules, 1325 dependencies cruised.
⚠ 7 known violations ignored. Run with --no-ignore-known to see them.

Types of changes

Checklist

codeclimate[bot] commented 6 months ago

Code Climate has analyzed commit f881ab9d and detected 0 issues on this pull request.

View more on Code Climate.