anchore / anchore/grant

bug: output can span many lines, making it difficult to read

Open
#276 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
183
Forks
18
Avg merge
3d 7h
Merged PRs (30d)
7

Description

**What happened**:

* Wanted to scan a [container](https://hub.docker.com/r/redpandadata/connectors) to get a list of licenses.
* Ran `grant check redpandadata/connectors:latest`
* Got output that was very difficult to read/parse at my default 178 chars wide terminal

Image

* Packages with multiple licenses result in v e r y w i d e output
* Zooming in/out to view the text actually crashed my terminal (Ghostty) completely.

For example:

```
jasper-libs 2.0.14-6.el8_10 JasPer Unknown
java-21-openjdk 1:21.0.8.0.9-1.el8 ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib and ISC and FTL and RSA Unknown
java-21-openjdk-devel 1:21.0.8.0.9-1.el8 ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib and ISC and FTL and RSA Unknown
java-21-openjdk-headless 1:21.0.8.0.9-1.el8 ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib and ISC and FTL and RSA Unknown
javapackages-filesystem 5.3.0-1.module+el8+2447+6f56d9a6 BSD Unknown
javassist 3.29.2-GA http://www.mozilla.org/MPL/MPL-1.1.html, http://www.gnu.org/licenses/lgpl-2.1.html, https://www.apache.org/licenses/LICENSE-2.0 Unknown
javax.activation-api 1.2.0 https://github.com/javaee/activation/blob/master/LICENSE.txt Unknown
javax.annotation-api 1.3.2 https://github.com/javaee/javax.annotation/blob/master/LICENSE Unknown
javax.servlet-api 3.1.0 https://glassfish.dev.java.net/nonav/public/CDDL+GPL.html Unknown
javax.ws.rs-api 2.1.1 http://www.eclipse.org/legal/epl-2.0, https://www.gnu.org/software/classpath/license.html Unknown
jaxb-api 2.3.1 https://oss.oracle.com/licenses/CDDL+GPL-1.1, https://oss.oracle.com/licenses/CDDL+GPL-1.1 Unknown
jbigkit-libs 2.1-14.el8 GPLv2+ Unknown
jersey-client 2.39.1 http://www.eclipse.org/legal/epl-2.0, https://www.gnu.org/software/classpath/license.html, http://www.eclipse.org/org/documents/edl-v10.php, https://opensource.org/licenses/BSD-2-Clause, http://www.apache.org/licenses/LICENSE-2.0.html, https://creativecommons.org/publicdomain/zero/1.0/, https://asm.ow2.io/license.html, jquery.org/license, http://www.opensource.org/licenses/mit-license.php, https://www.w3.org/Consortium/Legal/copyright-documents-19990405 Unknown
jersey-common 2.39.1 http://www.eclipse.org/legal/epl-2.0, https://www.gnu.org/software/classpath/license.html, http://www.apache.org/licenses/LICENSE-2.0.html, https://creativecommons.org/publicdomain/zero/1.0/ Unknown
jersey-container-servlet 2.39.1 http://www.eclipse.org/legal/epl-2.0, https://www.gnu.org/software/classpath/license.html, http://www.eclipse.org/org/documents/edl-v10.php, https://opensource.org/licenses/BSD-2-Clause, http://www.apache.org/licenses/LICENSE-2.0.html, https://creativecommons.org/publicdomain/zero/1.0/, https://asm.ow2.io/license.html, jquery.org/license, http://www.opensource.org/licenses/mit-license.php, https://www.w3.org/Consortium/Legal/copyright-documents-19990405 Unknown
jersey-container-servlet-core 2.39.1 http://www.eclipse.org/legal/epl-2.0, https://www.gnu.org/software/classpath/license.html, http://www.eclipse.org/org/documents/edl-v10.php, https://opensource.org/licenses/BSD-2-Clause, http://www.apache.org/licenses/LICENSE-2.0.html, https://creativecommons.org/publicdomain/zero/1.0/, https://asm.ow2.io/license.html, jquery.org/license, http://www.opensource.org/licenses/mit-license.php, https://www.w3.org/Consortium/Legal/copyright-documents-19990405 Unknown
jersey-hk2 2.39.1 http://www.eclipse.org/legal/epl-2.0, https://www.gnu.org/software/classpath/license.html, http://www.eclipse.org/org/documents/edl-v10.php, https://opensource.org/licenses/BSD-2-Clause, http://www.apache.org/licenses/LICENSE-2.0.html, https://creativecommons.org/publicdomain/zero/1.0/, https://asm.ow2.io/license.html, jquery.org/license, http://www.opensource.org/licenses/mit-license.php, https://www.w3.org/Consortium/Legal/copyright-documents-19990405 Unknown
jersey-server 2.39.1 http://www.eclipse.org/legal/epl-2.0, https://www.gnu.org/software/classpath/license.html, http://www.apache.org/licenses/LICENSE-2.0.html, https://asm.ow2.io/license.html Unknown
jetty-client 9.4.56.v20240826 http://www.apache.org/licenses/LICENSE-2.0, https://www.eclipse.org/org/documents/epl-v10.php Unknown
jetty-continuation 9.4.56.v20240826 http://www.apache.org/licenses/LICENSE-2.0, https://www.eclipse.org/org/documents/epl-v10.php Unknown
jetty-http 9.4.56.v20240826 http://www.apache.org/licenses/LICENSE-2.0, https://www.eclipse.org/org/documents/epl-v10.php Unknown
jetty-io 9.4.56.v20240826 http://www.apache.org/licenses/LICENSE-2.0, https://www.eclipse.org/org/documents/epl-v10.php Unknown
jetty-security 9.4.56.v20240826 http://www.apache.org/licenses/LICENSE-2.0, https://www.eclipse.org/org/documents/epl-v10.php Unknown
jetty-server 9.4.56.v20240826 http://www.apache.org/licenses/LICENSE-2.0, https://www.eclipse.org/org/documents/epl-v10.php Unknown
jetty-servlet 9.4.56.v20240826 http://www.apache.org/licenses/LICENSE-2.0, https://www.eclipse.org/org/documents/epl-v10.php Unknown
jetty-servlets 9.4.56.v20240826 http://www.apache.org/licenses/LICENSE-2.0, https://www.eclipse.org/org/documents/epl-v10.php Unknown
jetty-util 9.4.56.v20240826 http://www.apache.org/licenses/LICENSE-2.0, https://www.eclipse.org/org/documents/epl-v10.php Unknown
```

I have a big screen, but woah, 534 chars wide is too much, even for me.

Image

**What you expected to happen**:

🌟Pretty formatting🌟

Maybe have each license listed underneath eachother?

Like this:

```
jersey-container-servlet 2.39.1 http://www.eclipse.org/legal/epl-2.0 Unknown
https://www.gnu.org/software/classpath/license.html
http://www.eclipse.org/org/documents/edl-v10.php
https://opensource.org/licenses/BSD-2-Clause
http://www.apache.org/licenses/LICENSE-2.0.html
https://creativecommons.org/publicdomain/zero/1.0/
https://asm.ow2.io/license.html
jquery.org/license
http://www.opensource.org/licenses/mit-license.php
https://www.w3.org/Consortium/Legal/copyright-documents-19990405
```

**Steps to reproduce the issue**:

```
grant check redpandadata/connectors:latest
```

**Anything else we need to know?**:

Fried pickles are delicious and are called "frickles".

**Environment**:
- Output of `grant version`: 0.3.2
- OS (e.g: `cat /etc/os-release` or similar): macos something something

Contributor guide

Open the contributing guide

Research direction

Start by running `grant check redpandadata/connectors:latest` and tracing the CLI output path that produces the package and license columns; the issue names no files or tests. Done means the license output remains readable in a 178-character terminal even when packages have many licenses.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.