New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

codeowners-audit

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codeowners-audit - npm Package Compare versions

Comparing version
2.4.0
to
2.5.0
+1
-1
package.json
{
"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",

@@ -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 @@

@@ -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 @@

@@ -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 @@ }