Skip to content

Feature: Configure Exported Fields #139

@MattTheCuber

Description

@MattTheCuber

Before You Begin

Before proceeding, please make sure to follow these steps:

  • I have checked for similar feature requests in the project's issue tracker
    to avoid duplicates.
  • I have searched existing issues to see if this feature has been discussed
    before.

Feature Details

Is your feature request related to a problem? Please describe

Yes, we are automating licensecheck in our CI and it frequently changes the size fields, committing the file when unnecessary.

Describe the solution you'd like

A new configuration option (exclude-fields) where people can configure which fields to exclude in the output.

Describe alternatives you've considered

Right now we are checking the diff to see if it includes lines other than the size.

files=$(git ls-files | grep 'licenses.json')
meaningful_changes=$(git diff -U0 "$files" | grep -E '^[+-]\s+' | grep -vE '^[+-]\s*"size":')
if [ -z "$meaningful_changes" ]; then
  echo "No changes to commit"
else
  ...
fi

Additional Context

Example:

$ licensecheck --help
...

--exclude-fields EXCLUDE_FIELDS [EXCLUDE_FIELDS ...]
                        List of fields to exclude from the output
...
$ licensecheck -f csv  --exclude-fields size
name,version,homePage,author,license,licenseCompat,errorCode,namever
Markdown,3.7,UNKNOWN,"Manfred Stienstra, Yuri Takhteyev",BSD LICENSE,False,0,Markdown-3.7
Pygments,2.19.1,UNKNOWN,UNKNOWN,BSD LICENSE,False,0,Pygments-2.19.1
boolean.py,4.0,https://github.com/bastikr/boolean.py,Sebastian Kraemer,BSD-2-CLAUSE,False,0,boolean.py-4.0
certifi,2025.1.31,https://github.com/certifi/python-certifi,Kenneth Reitz,MOZILLA PUBLIC LICENSE 2.0 _MPL 2.0_,False,0,certifi-2025.1.31
colorama,0.4.6,UNKNOWN,UNKNOWN,BSD LICENSE,False,0,colorama-0.4.6
idna,3.10,UNKNOWN,UNKNOWN,BSD LICENSE,False,0,idna-3.10
requests-cache,1.2.1,https://github.com/requests-cache/requests-cache,Roman Haritonov,BSD LICENSE,False,0,requests-cache-1.2.1

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions