Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Highlight offending non-free licenses #16

Open
IsaacGerma opened this issue Apr 12, 2024 · 3 comments
Open

Feature Request: Highlight offending non-free licenses #16

IsaacGerma opened this issue Apr 12, 2024 · 3 comments

Comments

@IsaacGerma
Copy link

When VRMS detects a package that seems to be non-free, it will currently list the non-free packages and all of the licenses associated with each one.

The main problem is that in the output, VRMS does not make a distinction between the free packages and the non-free packages, which can make it tedious to figure out why VRMS flagged a package.

This could be fixed by having color or some other form of highlighting in the output to indicate the status of a package and the associated license.

@gardenappl
Copy link
Owner

If we're handling the 'AND' operator and filtering out the known free licenses, it's probably easier to just display the licenses that are left afterwards.

@IsaacGerma
Copy link
Author

Not exactly the solution you mentioned, but re-writing list_all_nonfree_packages() like this would highlight the non-free licenses:

    def list_all_nonfree_packages(self):
        for nfpackage in sorted(self.nonfree_packages, key=lambda pkg: pkg.name):
            print("%s: [" % (nfpackage.name), end="")
            for license in nfpackage.licenses:
                clean_license = clean_license_name(license)
                if clean_license in FREE_LICENSES:
                    print(license, ", ", end="", sep="")
                else:
                    print("\033[91m{}, \033[00m" .format(license), end="")
            print("]"

image

@gardenappl
Copy link
Owner

I don't want to rely on color codes. The previous maintainer made the output machine-readable, maybe just because that's the simpler method, but in theory that output could be used in scripting, so to accommodate that we should specify which licenses are non-free without the use of ANSI color codes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants