lockfile-lint
Advanced tools
Comparing version 4.0.0 to 4.1.0
@@ -6,5 +6,13 @@ #!/usr/bin/env node | ||
const main = require('../src/main') | ||
const cli = require('../src/cli') | ||
debug(`parsed the following CLI arguments: ${JSON.stringify(cli)}`) | ||
let config | ||
try { | ||
config = require('../src/config')(process.argv) | ||
debug(`parsed the following options: ${JSON.stringify(config)}`) | ||
} catch (err) { | ||
debug(`error loading options from CLI arguments/files: ${err}`) | ||
process.exit(1) | ||
} | ||
let validators = [] | ||
@@ -17,3 +25,3 @@ const supportedValidators = new Map([ | ||
for (const [commandArgument, commandValue] of Object.entries(cli)) { | ||
for (const [commandArgument, commandValue] of Object.entries(config)) { | ||
if (supportedValidators.has(commandArgument)) { | ||
@@ -25,3 +33,3 @@ const validatorItem = supportedValidators.get(commandArgument) | ||
options: { | ||
emptyHostname: cli['empty-hostname'] | ||
emptyHostname: config['empty-hostname'] | ||
} | ||
@@ -35,4 +43,4 @@ }) | ||
result = main.runValidators({ | ||
path: cli['path'], | ||
type: cli['type'], | ||
path: config['path'], | ||
type: config['type'], | ||
validators | ||
@@ -39,0 +47,0 @@ }) |
@@ -6,2 +6,13 @@ # Change Log | ||
# [4.1.0](https://github.com/lirantal/lockfile-lint/compare/lockfile-lint@4.0.0...lockfile-lint@4.1.0) (2020-03-09) | ||
### Features | ||
* **cli:** add file-based configuration ([#75](https://github.com/lirantal/lockfile-lint/issues/75)) ([e183593](https://github.com/lirantal/lockfile-lint/commit/e183593)) | ||
# [4.0.0](https://github.com/lirantal/lockfile-lint/compare/lockfile-lint@3.0.18...lockfile-lint@4.0.0) (2020-02-20) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "lockfile-lint", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "A CLI to lint a lockfile for security policies", | ||
@@ -55,2 +55,3 @@ "bin": { | ||
"dependencies": { | ||
"cosmiconfig": "^6.0.0", | ||
"debug": "^4.1.1", | ||
@@ -182,3 +183,3 @@ "lockfile-lint-api": "^5.0.12", | ||
}, | ||
"gitHead": "3e894df6e50dc68745e916aca4545b7bc774d66b" | ||
"gitHead": "b481e8046cc5b8736263c3ce130c9783677460c5" | ||
} |
@@ -81,2 +81,15 @@ <p align="center"><h1 align="center"> | ||
# File-Based Configuration | ||
Lockfile-lint uses [cosmiconfig](https://github.com/davidtheclark/cosmiconfig) for configuration file support. This means you can configure the above options via (in order of precedence): | ||
- A "lockfile-lint" key in your package.json file. | ||
- A .lockfile-lintrc file, written in JSON or YAML, with optional extensions: .json/.yaml/.yml (without extension takes precedence). | ||
- A .lockfile-lint.js or lockfilelint.config.js file that exports an object. | ||
- A .lockfile-lint.toml file, written in TOML (the .toml extension is required). | ||
The configuration file will be resolved starting from the current working directory, and searching up the file tree until a config file is (or isn't) found. Command-line options take precedence over any file-based configuration. | ||
The options accepted in the configuration file are the same as the options above in camelcase (e.g. "path", "allowedHosts"). | ||
# Contributing | ||
@@ -83,0 +96,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40309
222
101
4
+ Addedcosmiconfig@^6.0.0
+ Added@babel/code-frame@7.26.2(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@types/parse-json@4.0.2(transitive)
+ Addedcallsites@3.1.0(transitive)
+ Addedcosmiconfig@6.0.0(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedimport-fresh@3.3.0(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedjson-parse-even-better-errors@2.3.1(transitive)
+ Addedlines-and-columns@1.2.4(transitive)
+ Addedparent-module@1.0.1(transitive)
+ Addedparse-json@5.2.0(transitive)
+ Addedpath-type@4.0.0(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedresolve-from@4.0.0(transitive)
+ Addedyaml@1.10.2(transitive)