codeowners-audit
Advanced tools
+1
-1
| { | ||
| "name": "codeowners-audit", | ||
| "version": "2.4.0", | ||
| "version": "2.5.0", | ||
| "description": "Generate an HTML report for CODEOWNERS ownership gaps and run in CI or from the CLI to fail when files are not covered.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
+2
-1
@@ -89,2 +89,3 @@ <p align="center"> | ||
| | `--fail-on-missing-paths` | Exit non-zero when one or more CODEOWNERS paths match no repository files | | ||
| | `--fail-on-location-warnings` | Exit non-zero when extra or ignored `CODEOWNERS` files are found | | ||
| | `-g, --glob <pattern>` | Repeatable file filter for report/check scope (default: `**`) | | ||
@@ -147,3 +148,3 @@ | `--suggest-teams` | Suggest `@org/team` for uncovered directories | | ||
| - Exit code `0`: all matched files are covered by `CODEOWNERS`. | ||
| - Exit code `1`: one or more matched files are uncovered, or `--fail-on-missing-paths` is enabled and one or more CODEOWNERS paths match no repository files. | ||
| - Exit code `1`: one or more matched files are uncovered, `--fail-on-missing-paths` is enabled and one or more CODEOWNERS paths match no repository files, or `--fail-on-location-warnings` is enabled and extra or ignored `CODEOWNERS` files are found. | ||
| - Exit code `2`: runtime/setup error (for example: not in a Git repository, missing `CODEOWNERS`, invalid arguments). | ||
@@ -150,0 +151,0 @@ |
+25
-5
@@ -243,2 +243,3 @@ #!/usr/bin/env node | ||
| * failOnMissingPaths: boolean, | ||
| * failOnLocationWarnings: boolean, | ||
| * checkGlobs: string[], | ||
@@ -274,2 +275,3 @@ * teamSuggestions: boolean, | ||
| let failOnMissingPaths = false | ||
| let failOnLocationWarnings = false | ||
| /** @type {string[]} */ | ||
@@ -442,2 +444,7 @@ let checkGlobs = [] | ||
| if (arg === '--fail-on-location-warnings') { | ||
| failOnLocationWarnings = true | ||
| continue | ||
| } | ||
| if (arg === '--glob' || arg === '-g') { | ||
@@ -557,2 +564,3 @@ checkGlobs.push(parseGlobOption(args[index + 1], '--glob')) | ||
| failOnMissingPaths, | ||
| failOnLocationWarnings, | ||
| checkGlobs, | ||
@@ -748,2 +756,3 @@ teamSuggestions, | ||
| ['--fail-on-missing-paths', 'Exit non-zero when CODEOWNERS paths match no files'], | ||
| ['--fail-on-location-warnings', 'Exit non-zero when extra or ignored CODEOWNERS files are found'], | ||
| ['-g, --glob <pattern>', 'Repeatable file filter for report/check scope (default: **)'], | ||
@@ -940,2 +949,6 @@ ['--suggest-teams', 'Suggest @org/team for uncovered directories'], | ||
| * }, | ||
| * codeownersFiles?: { | ||
| * path: string, | ||
| * rules: number | ||
| * }[], | ||
| * unownedFiles: string[], | ||
@@ -961,2 +974,3 @@ * codeownersValidationMeta?: { | ||
| * failOnMissingPaths: boolean, | ||
| * failOnLocationWarnings: boolean, | ||
| * checkGlobs: string[], | ||
@@ -971,2 +985,5 @@ * showCoverageSummary?: boolean, | ||
| : JSON.stringify(options.checkGlobs) | ||
| const activeCodeownersPath = Array.isArray(report.codeownersFiles) && report.codeownersFiles[0] | ||
| ? report.codeownersFiles[0].path | ||
| : null | ||
| const discoveryWarnings = Array.isArray(report.codeownersValidationMeta?.discoveryWarnings) | ||
@@ -1003,7 +1020,3 @@ ? report.codeownersValidationMeta.discoveryWarnings | ||
| for (const warning of missingPathWarnings) { | ||
| console.error( | ||
| '- %s (from %s)', | ||
| colorizeCliText(warning.pattern, [ANSI_YELLOW], colorStderr), | ||
| colorizeCliText(warning.codeownersPath, [ANSI_DIM], colorStderr) | ||
| ) | ||
| console.error('- %s', colorizeCliText(warning.pattern, [ANSI_YELLOW], colorStderr)) | ||
| } | ||
@@ -1032,2 +1045,5 @@ console.error('') | ||
| `${colorizeCliText('globs:', [ANSI_DIM], colorStdout)} ${globListLabel}`, | ||
| ...(activeCodeownersPath | ||
| ? [`${colorizeCliText('codeowners file:', [ANSI_DIM], colorStdout)} ${colorizeCliText(activeCodeownersPath, [ANSI_BOLD], colorStdout)}`] | ||
| : []), | ||
| `${colorizeCliText('analyzed files:', [ANSI_DIM], colorStdout)} ${colorizeCliText(String(report.totals.files), [ANSI_BOLD], colorStdout)}`, | ||
@@ -1054,2 +1070,6 @@ `${colorizeCliText('unknown files:', [ANSI_DIM], colorStdout)} ${colorizeCliText(String(report.totals.unowned), report.totals.unowned > 0 ? [ANSI_BOLD, ANSI_RED] : [ANSI_BOLD, ANSI_GREEN], colorStdout)}`, | ||
| } | ||
| if (options.failOnLocationWarnings && locationWarningCount > 0) { | ||
| process.exitCode = EXIT_CODE_UNCOVERED | ||
| } | ||
| } | ||
@@ -1056,0 +1076,0 @@ |
+0
-15
@@ -621,17 +621,2 @@ <!doctype html> | ||
| const textSpan = document.createElement('span') | ||
| textSpan.className = 'warning-text' | ||
| textSpan.textContent = ' (from ' | ||
| item.appendChild(textSpan) | ||
| const sourceSpan = document.createElement('span') | ||
| sourceSpan.className = 'warning-reference' | ||
| sourceSpan.textContent = warning.codeownersPath | ||
| item.appendChild(sourceSpan) | ||
| const trailingSpan = document.createElement('span') | ||
| trailingSpan.className = 'warning-text' | ||
| trailingSpan.textContent = ')' | ||
| item.appendChild(trailingSpan) | ||
| list.appendChild(item) | ||
@@ -638,0 +623,0 @@ } |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 6 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 6 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
143130
0.27%2828
0.64%232
0.43%