@runroom/code-quality 1.1.5 → 1.1.7
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.
- package/README.md +39 -0
- package/dist/cli.js +6 -2
- package/package.json +5 -1
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# @runroom/code-quality
|
|
2
|
+
|
|
3
|
+
This package is a thin launcher for an incremental quality gate for TypeScript/JavaScript, PHP, Python, and web templates. It runs the pinned Docker image `ghcr.io/runroom/code-quality`, and its findings use reduction-only baselines.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Docker must be running.
|
|
8
|
+
- Node 18 or newer is required for `npx`.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
npx @runroom/code-quality init # scaffold configuration and baselines
|
|
14
|
+
npx @runroom/code-quality check # run all configured checks
|
|
15
|
+
npx @runroom/code-quality check complexity duplication # run selected checks
|
|
16
|
+
npx @runroom/code-quality report # generate advisory reports
|
|
17
|
+
npx @runroom/code-quality doctor # verify tools and grammar assets
|
|
18
|
+
npx @runroom/code-quality versions # list pinned tool versions
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## How it works
|
|
22
|
+
|
|
23
|
+
Launcher X.Y.Z always runs image `ghcr.io/runroom/code-quality:vX.Y.Z`. The equivalent direct command is:
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
docker run --rm -v "$PWD:/work" ghcr.io/runroom/code-quality:vX.Y.Z <args>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`CODE_QUALITY_IMAGE` overrides the image and is validated as an image reference. Set it only to an image you trust because the current directory is mounted read-write into the container.
|
|
30
|
+
|
|
31
|
+
`CI`, `GITHUB_ACTIONS`, `NO_COLOR`, and `FORCE_COLOR` are forwarded to the container. `--color` and `--no-color` override everything; otherwise a non-empty `NO_COLOR` disables color, then `FORCE_COLOR` (any value but `0`) forces it, then color is on in GitHub Actions or when stdout is a TTY.
|
|
32
|
+
|
|
33
|
+
## Documentation
|
|
34
|
+
|
|
35
|
+
See the [repository documentation](https://github.com/Runroom/code-quality#readme) for `.code-quality.yml` configuration, checks, baselines, and the reusable GitHub Actions workflow.
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
|
|
39
|
+
MIT
|
package/dist/cli.js
CHANGED
|
@@ -38,9 +38,12 @@ function buildDockerArgs(ctx) {
|
|
|
38
38
|
if (ctx.platform === "linux" && ctx.uid !== void 0 && ctx.gid !== void 0) {
|
|
39
39
|
args.push("--user", `${ctx.uid}:${ctx.gid}`);
|
|
40
40
|
}
|
|
41
|
-
for (const name of ["CI", "GITHUB_ACTIONS"]) {
|
|
41
|
+
for (const name of ["CI", "GITHUB_ACTIONS", "NO_COLOR", "FORCE_COLOR"]) {
|
|
42
42
|
if (ctx.env[name] !== void 0) args.push("-e", name);
|
|
43
43
|
}
|
|
44
|
+
if (ctx.isTTY && !ctx.env.NO_COLOR && ctx.env.FORCE_COLOR === void 0) {
|
|
45
|
+
args.push("-e", "FORCE_COLOR=1");
|
|
46
|
+
}
|
|
44
47
|
args.push(ctx.image, ...ctx.argv);
|
|
45
48
|
return args;
|
|
46
49
|
}
|
|
@@ -71,7 +74,8 @@ try {
|
|
|
71
74
|
platform: process.platform,
|
|
72
75
|
...process.getuid ? { uid: process.getuid() } : {},
|
|
73
76
|
...process.getgid ? { gid: process.getgid() } : {},
|
|
74
|
-
image
|
|
77
|
+
image,
|
|
78
|
+
isTTY: process.stdout.isTTY === true
|
|
75
79
|
});
|
|
76
80
|
const result = spawnSync("docker", args, { stdio: "inherit" });
|
|
77
81
|
const outcome = resolveOutcome(result, image);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runroom/code-quality",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"description": "Runroom incremental quality gate — runs the pinned ghcr.io/runroom/code-quality image",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -24,5 +24,9 @@
|
|
|
24
24
|
"url": "git+https://github.com/Runroom/code-quality.git",
|
|
25
25
|
"directory": "launcher"
|
|
26
26
|
},
|
|
27
|
+
"homepage": "https://github.com/Runroom/code-quality#readme",
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/Runroom/code-quality/issues"
|
|
30
|
+
},
|
|
27
31
|
"license": "MIT"
|
|
28
32
|
}
|