Skip to content

Commit 17417ae

Browse files
author
Pelle Wessman
committed
Write docs for new globbing/ignore feature
1 parent bd3ae12 commit 17417ae

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ socket report view QXU8PmK7LfH608RAwfIKdbcHgwEd_ZeWJ9QEGv05FJUQ
2222
## Commands
2323

2424
* `socket info <package@version>` - looks up issues for a package
25-
* `socket report create <path(s)-to-folder-or-file>` - uploads the specified `package.json` and/or `package-lock.json` to create a report on [socket.dev](https://socket.dev/). If only one of a `package.json`/`package-lock.json` has been specified, the other will be automatically found and uploaded if it exists
25+
26+
* `socket report create <path(s)-to-folder-or-file>` - creates a report on [socket.dev](https://socket.dev/)
27+
28+
Uploads the specified `package.json` and lock files and, if any folder is specified, the ones found in there. Also includes the complementary `package.json` and lock file to any specified. Currently `package-lock.json` and `yarn.lock` are supported.
29+
30+
Supports globbing such as `**/package.json`.
31+
32+
Ignores any file specified in your project's `.gitignore`, the `projectIgnorePaths` in your project's [`socket.yml`](https://docs.socket.dev/docs/socket-yml) and on top of that has a sensible set of [default ignores](https://www.npmjs.com/package/ignore-by-default)
33+
2634
* `socket report view <report-id>` - looks up issues and scores from a report
2735

2836
## Flags
@@ -48,6 +56,10 @@ socket report view QXU8PmK7LfH608RAwfIKdbcHgwEd_ZeWJ9QEGv05FJUQ
4856
* `--help` - prints the help for the current command. All CLI tools should have this flag
4957
* `--version` - prints the version of the tool. All CLI tools should have this flag
5058

59+
## Configuration files
60+
61+
The CLI reads and uses data from a [`socket.yml` file](https://docs.socket.dev/docs/socket-yml) in the folder you run it in. It supports the version 2 of the `socket.yml` file format and makes use of the `projectIgnorePaths` to excludes files when creating a report.
62+
5163
## Environment variables
5264

5365
* `SOCKET_SECURITY_API_KEY` - if set, this will be used as the API-key

lib/commands/report/create.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,17 @@ async function setupCommand (name, description, argv, importMeta) {
7878
Usage
7979
$ ${name} <paths-to-package-folders-and-files>
8080
81+
Uploads the specified "package.json" and lock files and, if any folder is
82+
specified, the ones found in there. Also includes the complementary
83+
"package.json" and lock file to any specified. Currently "package-lock.json"
84+
and "yarn.lock" are supported.
85+
86+
Supports globbing such as "**/package.json".
87+
88+
Ignores any file specified in your project's ".gitignore", your project's
89+
"socket.yml" file's "projectIgnorePaths" and also has a sensible set of
90+
default ignores from the "ignore-by-default" module.
91+
8192
Options
8293
${printFlagList({
8394
'--all': 'Include all issues',
@@ -91,7 +102,7 @@ async function setupCommand (name, description, argv, importMeta) {
91102
92103
Examples
93104
$ ${name} .
94-
$ ${name} ../package-lock.json
105+
$ ${name} '**/package.json'
95106
$ ${name} /path/to/a/package.json /path/to/another/package.json
96107
$ ${name} . --view --json
97108
`, {

0 commit comments

Comments
 (0)