Repository: sverweij/dependency-cruiser
Pull request #889 (2023-12-18 07:44:15)

ci(deps): bump github/codeql-action from 2 to 3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/github/codeql-action/releases">github/codeql-action's releases</a>.</em></p>
<blockquote>
<h2>CodeQL Bundle v2.15.4</h2>
<p>Bundles CodeQL CLI v2.15.4</p>
<ul>
<li>(<a href="https://github.com/github/codeql-cli-binaries/blob/HEAD/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql-cli-binaries/releases/tag/v2.15.4">release</a>)</li>
</ul>
<p>Includes the following CodeQL language packs from <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4"><code>github/codeql@codeql-cli/v2.15.4</code></a>:</p>
<ul>
<li><code>codeql/cpp-queries</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/cpp/ql/src/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/cpp/ql/src">source</a>)</li>
<li><code>codeql/cpp-all</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/cpp/ql/lib/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/cpp/ql/lib">source</a>)</li>
<li><code>codeql/csharp-queries</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/csharp/ql/src/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/csharp/ql/src">source</a>)</li>
<li><code>codeql/csharp-all</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/csharp/ql/lib/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/csharp/ql/lib">source</a>)</li>
<li><code>codeql/go-queries</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/go/ql/src/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/go/ql/src">source</a>)</li>
<li><code>codeql/go-all</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/go/ql/lib/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/go/ql/lib">source</a>)</li>
<li><code>codeql/java-queries</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/java/ql/src/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/java/ql/src">source</a>)</li>
<li><code>codeql/java-all</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/java/ql/lib/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/java/ql/lib">source</a>)</li>
<li><code>codeql/javascript-queries</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/javascript/ql/src/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/javascript/ql/src">source</a>)</li>
<li><code>codeql/javascript-all</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/javascript/ql/lib/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/javascript/ql/lib">source</a>)</li>
<li><code>codeql/python-queries</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/python/ql/src/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/python/ql/src">source</a>)</li>
<li><code>codeql/python-all</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/python/ql/lib/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/python/ql/lib">source</a>)</li>
<li><code>codeql/ruby-queries</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/ruby/ql/src/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/ruby/ql/src">source</a>)</li>
<li><code>codeql/ruby-all</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/ruby/ql/lib/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/ruby/ql/lib">source</a>)</li>
<li><code>codeql/swift-queries</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/swift/ql/src/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/swift/ql/src">source</a>)</li>
<li><code>codeql/swift-all</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/swift/ql/lib/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.4/swift/ql/lib">source</a>)</li>
</ul>
<h2>CodeQL Bundle</h2>
<p>Bundles CodeQL CLI v2.15.3</p>
<ul>
<li>(<a href="https://github.com/github/codeql-cli-binaries/blob/HEAD/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql-cli-binaries/releases/tag/v2.15.3">release</a>)</li>
</ul>
<p>Includes the following CodeQL language packs from <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3"><code>github/codeql@codeql-cli/v2.15.3</code></a>:</p>
<ul>
<li><code>codeql/cpp-queries</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/cpp/ql/src/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/cpp/ql/src">source</a>)</li>
<li><code>codeql/cpp-all</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/cpp/ql/lib/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/cpp/ql/lib">source</a>)</li>
<li><code>codeql/csharp-queries</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/csharp/ql/src/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/csharp/ql/src">source</a>)</li>
<li><code>codeql/csharp-all</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/csharp/ql/lib/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/csharp/ql/lib">source</a>)</li>
<li><code>codeql/go-queries</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/go/ql/src/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/go/ql/src">source</a>)</li>
<li><code>codeql/go-all</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/go/ql/lib/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/go/ql/lib">source</a>)</li>
<li><code>codeql/java-queries</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/java/ql/src/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/java/ql/src">source</a>)</li>
<li><code>codeql/java-all</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/java/ql/lib/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/java/ql/lib">source</a>)</li>
<li><code>codeql/javascript-queries</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/javascript/ql/src/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/javascript/ql/src">source</a>)</li>
<li><code>codeql/javascript-all</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/javascript/ql/lib/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/javascript/ql/lib">source</a>)</li>
<li><code>codeql/python-queries</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/python/ql/src/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/python/ql/src">source</a>)</li>
<li><code>codeql/python-all</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/python/ql/lib/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/python/ql/lib">source</a>)</li>
<li><code>codeql/ruby-queries</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/ruby/ql/src/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/ruby/ql/src">source</a>)</li>
<li><code>codeql/ruby-all</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/ruby/ql/lib/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/ruby/ql/lib">source</a>)</li>
<li><code>codeql/swift-queries</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/swift/ql/src/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/swift/ql/src">source</a>)</li>
<li><code>codeql/swift-all</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/swift/ql/lib/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.3/swift/ql/lib">source</a>)</li>
</ul>
<h2>CodeQL Bundle</h2>
<p>Bundles CodeQL CLI v2.15.2</p>
<ul>
<li>(<a href="https://github.com/github/codeql-cli-binaries/blob/HEAD/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql-cli-binaries/releases/tag/v2.15.2">release</a>)</li>
</ul>
<p>Includes the following CodeQL language packs from <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.2"><code>github/codeql@codeql-cli/v2.15.2</code></a>:</p>
<ul>
<li><code>codeql/cpp-queries</code> (<a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.2/cpp/ql/src/CHANGELOG.md">changelog</a>, <a href="https://github.com/github/codeql/tree/codeql-cli/v2.15.2/cpp/ql/src">source</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/github/codeql-action/blob/main/CHANGELOG.md">github/codeql-action's changelog</a>.</em></p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/github/codeql-action/commit/3a9f6a89e06fb331ce22481637d19617501a5b7f"><code>3a9f6a8</code></a> update javascript files</li>
<li><a href="https://github.com/github/codeql-action/commit/cc4fead714532424ab15b501a01d18c7f34d17e2"><code>cc4fead</code></a> update version in various hardcoded locations</li>
<li><a href="https://github.com/github/codeql-action/commit/183559cea87c163bb01e99e0a15fd5500b23307f"><code>183559c</code></a> Merge branch 'main' into update-bundle/codeql-bundle-v2.15.4</li>
<li><a href="https://github.com/github/codeql-action/commit/5b52b36d41451ee775917788e3bf225d7c1ceab3"><code>5b52b36</code></a> reintroduce PR check that confirm action can be still be compiled on node16</li>
<li><a href="https://github.com/github/codeql-action/commit/5b19bef41e08b00f3d8f48219f46b1866a4f940d"><code>5b19bef</code></a> change to node20 for all actions</li>
<li><a href="https://github.com/github/codeql-action/commit/f2d0c2e7ae58b70f81b81bf4c8b5c7a81fb2a5d6"><code>f2d0c2e</code></a> upgrade node type definitions</li>
<li><a href="https://github.com/github/codeql-action/commit/d651fbc494fab13836ab76ffcfc8ce08c7c98d78"><code>d651fbc</code></a> change to node20 for all actions</li>
<li><a href="https://github.com/github/codeql-action/commit/382a50a0284c0de445104889a9d6003acb4b3c1d"><code>382a50a</code></a> Merge pull request <a href="https://redirect.github.com/github/codeql-action/issues/2021">#2021</a> from github/mergeback/v2.22.9-to-main-c0d1daa7</li>
<li><a href="https://github.com/github/codeql-action/commit/458b4226ad8e38f90ff6a4ad1e18ab2593e7e3dc"><code>458b422</code></a> Update checked-in dependencies</li>
<li><a href="https://github.com/github/codeql-action/commit/5e0f9dbc48f564b68392e465dcdacd74eab63e25"><code>5e0f9db</code></a> Update changelog and version after v2.22.9</li>
<li>See full diff in <a href="https://github.com/github/codeql-action/compare/v2...v3">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github/codeql-action&package-manager=github_actions&previous-version=2&new-version=3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/.github/workflows/codeql-schedule.yml b/.github/workflows/codeql-schedule.yml
index 4d65e2bc..feae058f 100644
--- a/.github/workflows/codeql-schedule.yml
+++ b/.github/workflows/codeql-schedule.yml
@@ -16,9 +16,9 @@ jobs:
 
     steps:
       - uses: actions/checkout@v4
-      - uses: github/codeql-action/init@v2
+      - uses: github/codeql-action/init@v3
         with:
           languages: javascript
           # See https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
           config-file: ./.github/codeql/codeql-config.yml
-      - uses: github/codeql-action/analyze@v2
+      - uses: github/codeql-action/analyze@v3
diff --git a/src/config-utl/extract-known-violations.mjs b/src/config-utl/extract-known-violations.mjs
index ac58ee61..b741b973 100644
--- a/src/config-utl/extract-known-violations.mjs
+++ b/src/config-utl/extract-known-violations.mjs
@@ -2,15 +2,55 @@ import { readFile } from "node:fs/promises";
 import json5 from "json5";
 import makeAbsolute from "./make-absolute.mjs";
 
+/**
+ * @typedef {import("../../types/violations.d.mjs").IViolation} IViolation
+ * @typedef {import("../../types/shared-types.d.mts").DependencyType} DependencyType
+ *
+ * @typedef {IViolation & {cycle: Array<{name: string, dependencyTypes: Array<DependencyType>}>} | {cycle: Array<DependencyType>}} IMaybeOldFormatViolation
+ */
+
+/**
+ * cycles went from Array<string> to Array<{name: string, dependencyTypes: Array<DependencyType>}>
+ * in version 16.0.0. Known violations would typically be still in the old
+ * format. To prevent customers from bumping into error messages and having
+ * to update or regenerate their known violations, we'll make the old format
+ * forward compatible with this.
+ *
+ * @param {IMaybeOldFormatViolation} pKnownViolation
+ * @returns {IViolation}
+ */
+function makeForwardCompatible(pKnownViolation) {
+  if (Boolean(pKnownViolation.cycle)) {
+    return {
+      ...pKnownViolation,
+      cycle: pKnownViolation.cycle.map((pModule) => {
+        if (Boolean(pModule.name)) {
+          return pModule;
+        }
+        return {
+          name: pModule,
+          dependencyTypes: [],
+        };
+      }),
+    };
+  }
+  return pKnownViolation;
+}
+
 export default async function extractKnownViolations(pKnownViolationsFileName) {
   try {
-    return json5.parse(
-      await readFile(makeAbsolute(pKnownViolationsFileName), "utf8")
+    const lFileContents = await readFile(
+      makeAbsolute(pKnownViolationsFileName),
+      "utf8",
     );
+    const lKnownViolations = json5.parse(lFileContents);
+    const lForwardCompatible = lKnownViolations.map(makeForwardCompatible);
+
+    return lForwardCompatible;
   } catch (pError) {
     if (pError instanceof SyntaxError) {
       throw new SyntaxError(
-        `'${pKnownViolationsFileName}' should be valid json\n          ${pError}`
+        `'${pKnownViolationsFileName}' should be valid json\n          ${pError}`,
       );
     }
     throw pError;


Test patch:
diff --git a/test/config-utl/__mocks__/known-violations/known-violations-with-cycles-in-new-format.json b/test/config-utl/__mocks__/known-violations/known-violations-with-cycles-in-new-format.json
new file mode 100644
index 00000000..130033b4
--- /dev/null
+++ b/test/config-utl/__mocks__/known-violations/known-violations-with-cycles-in-new-format.json
@@ -0,0 +1,47 @@
+[
+  {
+    "type": "cycle",
+    "from": "tmp-errors/cycle-1.js",
+    "to": "tmp-errors/cycle-2.js",
+    "rule": {
+      "severity": "error",
+      "name": "no-circular"
+    },
+    "cycle": [
+      {
+        "name": "tmp-errors/cycle-2.js",
+        "dependencyTypes": ["local", "require"]
+      },
+      {
+        "name": "tmp-errors/cycle-3.js",
+        "dependencyTypes": ["local", "require"]
+      },
+      {
+        "name": "tmp-errors/cycle-4.js",
+        "dependencyTypes": ["local", "require"]
+      },
+      {
+        "name": "tmp-errors/cycle-1.js",
+        "dependencyTypes": ["local", "require"]
+      }
+    ]
+  },
+  {
+    "type": "module",
+    "from": "tmp-errors/mod.mts",
+    "to": "tmp-errors/mod.mts",
+    "rule": {
+      "severity": "error",
+      "name": "no-orphans"
+    }
+  },
+  {
+    "type": "dependency",
+    "from": "tmp-errors/call-mod.mts",
+    "to": "./mod.mjs",
+    "rule": {
+      "severity": "error",
+      "name": "not-to-unresolvable"
+    }
+  }
+]
diff --git a/test/config-utl/__mocks__/known-violations/known-violations-with-cycles-in-old-format.json b/test/config-utl/__mocks__/known-violations/known-violations-with-cycles-in-old-format.json
new file mode 100644
index 00000000..a3d38a72
--- /dev/null
+++ b/test/config-utl/__mocks__/known-violations/known-violations-with-cycles-in-old-format.json
@@ -0,0 +1,35 @@
+[
+  {
+    "type": "cycle",
+    "from": "tmp-errors/cycle-1.js",
+    "to": "tmp-errors/cycle-2.js",
+    "rule": {
+      "severity": "error",
+      "name": "no-circular"
+    },
+    "cycle": [
+      "tmp-errors/cycle-2.js",
+      "tmp-errors/cycle-3.js",
+      "tmp-errors/cycle-4.js",
+      "tmp-errors/cycle-1.js"
+    ]
+  },
+  {
+    "type": "module",
+    "from": "tmp-errors/mod.mts",
+    "to": "tmp-errors/mod.mts",
+    "rule": {
+      "severity": "error",
+      "name": "no-orphans"
+    }
+  },
+  {
+    "type": "dependency",
+    "from": "tmp-errors/call-mod.mts",
+    "to": "./mod.mjs",
+    "rule": {
+      "severity": "error",
+      "name": "not-to-unresolvable"
+    }
+  }
+]
diff --git a/test/config-utl/extract-known-violations.spec.mjs b/test/config-utl/extract-known-violations.spec.mjs
index 748e5e39..53f6f11a 100644
--- a/test/config-utl/extract-known-violations.spec.mjs
+++ b/test/config-utl/extract-known-violations.spec.mjs
@@ -55,4 +55,116 @@ describe("[I] config-utl/extractKnownViolations", () => {
       },
     ]);
   });
+
+  it("Makes a forward compatible version of the known violations", async () => {
+    process.chdir("./test/config-utl/__mocks__/known-violations");
+    deepEqual(
+      await extractKnownViolations(
+        "known-violations-with-cycles-in-old-format.json",
+      ),
+      [
+        {
+          type: "cycle",
+          from: "tmp-errors/cycle-1.js",
+          to: "tmp-errors/cycle-2.js",
+          rule: {
+            severity: "error",
+            name: "no-circular",
+          },
+          cycle: [
+            {
+              name: "tmp-errors/cycle-2.js",
+              dependencyTypes: [],
+            },
+            {
+              name: "tmp-errors/cycle-3.js",
+              dependencyTypes: [],
+            },
+            {
+              name: "tmp-errors/cycle-4.js",
+              dependencyTypes: [],
+            },
+            {
+              name: "tmp-errors/cycle-1.js",
+              dependencyTypes: [],
+            },
+          ],
+        },
+        {
+          type: "module",
+          from: "tmp-errors/mod.mts",
+          to: "tmp-errors/mod.mts",
+          rule: {
+            severity: "error",
+            name: "no-orphans",
+          },
+        },
+        {
+          type: "dependency",
+          from: "tmp-errors/call-mod.mts",
+          to: "./mod.mjs",
+          rule: {
+            severity: "error",
+            name: "not-to-unresolvable",
+          },
+        },
+      ],
+    );
+  });
+
+  it("Leaves new format cycles alone", async () => {
+    process.chdir("./test/config-utl/__mocks__/known-violations");
+    deepEqual(
+      await extractKnownViolations(
+        "known-violations-with-cycles-in-new-format.json",
+      ),
+      [
+        {
+          type: "cycle",
+          from: "tmp-errors/cycle-1.js",
+          to: "tmp-errors/cycle-2.js",
+          rule: {
+            severity: "error",
+            name: "no-circular",
+          },
+          cycle: [
+            {
+              name: "tmp-errors/cycle-2.js",
+              dependencyTypes: ["local", "require"],
+            },
+            {
+              name: "tmp-errors/cycle-3.js",
+              dependencyTypes: ["local", "require"],
+            },
+            {
+              name: "tmp-errors/cycle-4.js",
+              dependencyTypes: ["local", "require"],
+            },
+            {
+              name: "tmp-errors/cycle-1.js",
+              dependencyTypes: ["local", "require"],
+            },
+          ],
+        },
+        {
+          type: "module",
+          from: "tmp-errors/mod.mts",
+          to: "tmp-errors/mod.mts",
+          rule: {
+            severity: "error",
+            name: "no-orphans",
+          },
+        },
+        {
+          type: "dependency",
+          from: "tmp-errors/call-mod.mts",
+          to: "./mod.mjs",
+          rule: {
+            severity: "error",
+            name: "not-to-unresolvable",
+          },
+        },
+      ],
+    );
+  });
 });