From f8efdb749428a00985ce6f09b630c753c5c92004 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Thu, 24 Mar 2022 15:07:01 -0700 Subject: [PATCH] docs: document environment variables Closes #80 --- docs/detectors/go.md | 7 +++++++ docs/detectors/pip.md | 5 +++++ docs/environment-variables.md | 15 +++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 docs/environment-variables.md diff --git a/docs/detectors/go.md b/docs/detectors/go.md index 6f48d9b70..b47111819 100644 --- a/docs/detectors/go.md +++ b/docs/detectors/go.md @@ -36,3 +36,10 @@ Go detection will fallback if no Go v1.11+ is present. Due to the nature of `go.sum` containing references for all dependencies, including historical, no-longer-needed dependencies; the fallback strategy can result in over detection. Executing `go mod tidy` before detection via fallback is encouraged. + +## Environment Variables + +If the environment variable `EnableGoCliScan` is set, to any value, the Go detector uses [`go mod graph`][1] to discover Go dependencies. +If the environment variable is not present, we fall back to parsing `go.mod` and `go.sum` ourselves. + +[1]: https://go.dev/ref/mod#go-mod-graph diff --git a/docs/detectors/pip.md b/docs/detectors/pip.md index 0bb4f3e25..4a7d24da3 100644 --- a/docs/detectors/pip.md +++ b/docs/detectors/pip.md @@ -35,3 +35,8 @@ Pip detection will not run if `python` is unavailable. If no `bdist_wheel` or `bdist_egg` are available for a given component, dependencies will not be fetched. If no internet connection or a component cannot be found in Pypi, said component and its dependencies will be skipped. + +## Environment Variables + +The environment variable `PyPiMaxCacheEntries` is used to control the size of the in-memory LRU cache that caches responses from PyPi. +The default value is 128. diff --git a/docs/environment-variables.md b/docs/environment-variables.md new file mode 100644 index 000000000..6ce77ec03 --- /dev/null +++ b/docs/environment-variables.md @@ -0,0 +1,15 @@ +# Environment Variables + +Environment variables are sometimes used to control experimental features or advanced options + +## `EnableGoCliScan` + +If the environment variable `EnableGoCliScan` is set, to any value, the Go detector uses [`go mod graph`][1] to discover Go dependencies. +If the environment variable is not set, we fall back to parsing `go.mod` and `go.sum` ourselves. + +## `PyPiMaxCacheEntries` + +The environment variable `PyPiMaxCacheEntries` is used to control the size of the in-memory LRU cache that caches responses from PyPi. +The default value is 128. + +[1]: https://go.dev/ref/mod#go-mod-graph