From 1db10969b5f72bc42da5e69c610dcf0593df253a Mon Sep 17 00:00:00 2001 From: Emily McMullan Date: Wed, 1 Nov 2023 15:05:23 -0400 Subject: [PATCH] add docs for analyze and dev Signed-off-by: Emily McMullan --- README.md | 3 --- docs/analyzer.md | 11 +++++++++++ docs/developer.md | 15 +++++++++++++++ docs/windup.md | 10 ++++++++++ 4 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 docs/analyzer.md create mode 100644 docs/developer.md create mode 100644 docs/windup.md diff --git a/README.md b/README.md index d8ca797..34cb722 100644 --- a/README.md +++ b/README.md @@ -93,9 +93,6 @@ Flags: Use "kantra [command] --help" for more information about a command. ``` -Additionally, two environment variables control the container runtime and the kantra image: `PODMAN_BIN` and `RUNNER_IMG`: -- `PODMAN_BIN`: path to your container runtime (podman or docker); ie: `PODMAN_BIN=/usr/local/bin/docker` -- `RUNNER_IMG`: the tag of the kantra image to invoke; ie: `RUNNER_IMG=localhost/kantra:latest` ### Analyze diff --git a/docs/analyzer.md b/docs/analyzer.md new file mode 100644 index 0000000..4c6486b --- /dev/null +++ b/docs/analyzer.md @@ -0,0 +1,11 @@ +## Analyzer-lsp Documentation + +### kantra analyze runs [analyzer-lsp](https://github.com/konveyor/analyzer-lsp) + +- To better understand how rules are used in analysis, see the [rules](https://github.com/konveyor/analyzer-lsp/blob/main/docs/rules.md) +documentation + +- If a rule is matched, it creates a [violation](https://github.com/konveyor/analyzer-lsp/blob/main/docs/violations.md) + +- [Labels](https://github.com/konveyor/analyzer-lsp/blob/main/docs/labels.md) +can be used to filter in and out rules diff --git a/docs/developer.md b/docs/developer.md new file mode 100644 index 0000000..31ddd74 --- /dev/null +++ b/docs/developer.md @@ -0,0 +1,15 @@ +### Running kantra + +Two environment variables control the container runtime and the kantra image: `PODMAN_BIN` and `RUNNER_IMG`: +- `PODMAN_BIN`: path to your container runtime (podman or docker) +- `RUNNER_IMG`: the tag of the kantra image to invoke + +#### example: + +`podman build -f Dockerfile -t kantra:dev` + +`RUNNER_IMG=kantra:dev PODMAN_BIN=/usr/local/bin/podman go run main.go analyze --input= --output=./output` + +#### Helpful flags: +- To increase logs for debugging, you can set `--log-level` (default is 5) +- ie: `--log-level=7` diff --git a/docs/windup.md b/docs/windup.md new file mode 100644 index 0000000..ce1e72a --- /dev/null +++ b/docs/windup.md @@ -0,0 +1,10 @@ +## Known differences between Windup and kantra output + +#### `--rules` + `--target` +- In Windup, you can specify a custom rule with a target. If the custom rule does not +have a label with the given target specified, it will **still** run the rule. + +- In kantra, if a rule is given as well as a target, but the given rule **does not** +have the target label, the given rule will not match. + - You must add the target label to the custom rule (if applicable) in + order to run this rule.