@staff0rd/assist 0.88.1 → 0.89.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""Check file-level maintainability index using radon."""
|
|
2
|
+
|
|
3
|
+
import glob
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
from radon.metrics import mi_visit
|
|
7
|
+
|
|
8
|
+
MIN_MI = 20 # Grade B threshold
|
|
9
|
+
|
|
10
|
+
failed = []
|
|
11
|
+
for path in sorted(glob.glob("src/commands/voice/python/**/*.py", recursive=True)):
|
|
12
|
+
with open(path) as f:
|
|
13
|
+
mi = mi_visit(f.read(), True)
|
|
14
|
+
if mi < MIN_MI:
|
|
15
|
+
failed.append((path, mi))
|
|
16
|
+
|
|
17
|
+
if failed:
|
|
18
|
+
print("Files with low maintainability index:")
|
|
19
|
+
for path, mi in failed:
|
|
20
|
+
print(f" {path} - MI: {mi:.1f}")
|
|
21
|
+
sys.exit(1)
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.89.1",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -3642,7 +3642,9 @@ function fetchThreadIds(org, repo, prNumber) {
|
|
|
3642
3642
|
// src/commands/prs/listComments/fetchReviewComments.ts
|
|
3643
3643
|
import { execSync as execSync21 } from "child_process";
|
|
3644
3644
|
function fetchJson(endpoint) {
|
|
3645
|
-
const result = execSync21(`gh api ${endpoint}`, {
|
|
3645
|
+
const result = execSync21(`gh api --paginate ${endpoint}`, {
|
|
3646
|
+
encoding: "utf-8"
|
|
3647
|
+
});
|
|
3646
3648
|
if (!result.trim()) return [];
|
|
3647
3649
|
return JSON.parse(result);
|
|
3648
3650
|
}
|