Skip to content

Commit

Permalink
fix(integrity): rename command-line argument from `--validate-integri…
Browse files Browse the repository at this point in the history
…ty-sha512` to `--validate-integrity` (#144)
  • Loading branch information
yoavain authored Sep 30, 2022
1 parent 6d689bd commit a29d18b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
26 changes: 13 additions & 13 deletions packages/lockfile-lint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@ lockfile-lint --path yarn.lock --allowed-hosts yarn --allowed-urls https://githu

# CLI command options

| command line argument | description | implemented |
|--------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|
| `--path`, `-p` | path to the lockfile ||
| `--type`, `-t` | lockfile type, options are `npm` or `yarn` ||
| `--format`, `-f` | sets what type of report output is desired, one of [ `pretty`, `plain` ] with `plain` removing colors & status symbols from output ||
| `--validate-https`, `-s` | validates the use of HTTPS as protocol schema for all resources in the lockfile ||
| `--allowed-hosts`, `-a` | validates a list of allowed hosts to be used for all resources in the lockfile. Supported short-hands aliases are `npm`, `yarn`, and `verdaccio` which will match URLs `https://registry.npmjs.org`, `https://registry.yarnpkg.com` and `https://registry.verdaccio.org` respectively ||
| `--allowed-schemes`, `-o` | allowed [URI schemes](https://tools.ietf.org/html/rfc2396#section-3.1) such as "https:", "http", "git+ssh:", or "git+https:" ||
| `--allowed-urls`, `-u` | allowed URLs (e.g. `https://github.com/some-org/some-repo#some-hash`) ||
| `--empty-hostname`, `-e` | allow empty hostnames, or set to false if you wish for a stricter policy ||
| `--validate-package-names`, `-n` | validates that the resolved URL matches the package name ||
| `--validate-checksum`, `-c` | check that all resources include a checksum | ❌ PRs welcome |
| `--validate-integrity-sha512`, `-i` | validates the integrity field is a sha512 hash ||
| command line argument | description | implemented |
|----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|
| `--path`, `-p` | path to the lockfile ||
| `--type`, `-t` | lockfile type, options are `npm` or `yarn` ||
| `--format`, `-f` | sets what type of report output is desired, one of [ `pretty`, `plain` ] with `plain` removing colors & status symbols from output ||
| `--validate-https`, `-s` | validates the use of HTTPS as protocol schema for all resources in the lockfile ||
| `--allowed-hosts`, `-a` | validates a list of allowed hosts to be used for all resources in the lockfile. Supported short-hands aliases are `npm`, `yarn`, and `verdaccio` which will match URLs `https://registry.npmjs.org`, `https://registry.yarnpkg.com` and `https://registry.verdaccio.org` respectively ||
| `--allowed-schemes`, `-o` | allowed [URI schemes](https://tools.ietf.org/html/rfc2396#section-3.1) such as "https:", "http", "git+ssh:", or "git+https:" ||
| `--allowed-urls`, `-u` | allowed URLs (e.g. `https://github.com/some-org/some-repo#some-hash`) ||
| `--empty-hostname`, `-e` | allow empty hostnames, or set to false if you wish for a stricter policy ||
| `--validate-package-names`, `-n` | validates that the resolved URL matches the package name ||
| `--validate-checksum`, `-c` | check that all resources include a checksum | ❌ PRs welcome |
| `--validate-integrity`, `-i` | validates the integrity field is a sha512 hash ||

# File-Based Configuration

Expand Down
2 changes: 1 addition & 1 deletion packages/lockfile-lint/bin/lockfile-lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const supportedValidators = new Map([
['validate-package-names', 'ValidatePackageNames'],
['allowed-schemes', 'validateSchemes'],
['allowed-urls', 'validateUrls'],
['validate-integrity-sha512', 'validateIntegrity']
['validate-integrity', 'validateIntegrity']
])

for (const [commandArgument, commandValue] of Object.entries(config)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/lockfile-lint/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports = (argv, exitProcess = false, searchFrom = process.cwd()) => {
implies: 'allowed-hosts'
},
i: {
alias: ['validate-integrity-sha512'],
alias: ['validate-integrity'],
type: 'boolean',
describe: 'validates that the integrity hash type is sha512'
},
Expand Down

0 comments on commit a29d18b

Please sign in to comment.