Skip to content

Refactor: Removing/updating some filtering options, add quiet, change handling of JSON format and console output#3

Open
sascgc wants to merge 14 commits intobootlin:mainfrom
sascgc:main
Open

Refactor: Removing/updating some filtering options, add quiet, change handling of JSON format and console output#3
sascgc wants to merge 14 commits intobootlin:mainfrom
sascgc:main

Conversation

@sascgc
Copy link
Copy Markdown

@sascgc sascgc commented Apr 8, 2026

This pull request contains:

  • Removing output filtering options:

    • --show-added
    • --show-changed
    • --show-removed
  • The default behaviour is to show the full spdx diff, follwing arguments are removed:

    • --full
    • --summary
  • Following parameters have been renamed and changed to boolean with TRUE as default value:

    • --show-packages to --packages(default) and --no-packages
    • --show-config to --kernel-config(default) and --no-kernel-config
    • --show-packageconfig to --packageconfig(default) and --no-packageconfig
    • --ignore-proprietary to --packages-proprietary(default) and --no-packages-proprietary
  • Added quiet mode (decreasing verbosity to ERROR only)

  • Console output handling has been updated:

    • Human-readable output is now redirected to stderr
    • Structured JSON output is emitted on stdout to facilitate seamless
      integration of the tool into automated pipelines and scripting workflows.
  • The JSON output file has been updated:

    • The JSON output file is no longer generated by default.
    • The --output <PATH> option have been renamed to --json-output <PATH>
    • The --json-output <PATH> option must now be explicitly specified to enable JSON file generation.

    Not tested yet with meta-spdx-diff-test. Just test "on table".

@sascgc
Copy link
Copy Markdown
Author

sascgc commented Apr 8, 2026

See tests failing on the workflow, the tests needs to be updated as the tool has changed. Working on it.

@sascgc sascgc force-pushed the main branch 2 times, most recently from eaab371 to a334883 Compare April 8, 2026 14:31
@sascgc
Copy link
Copy Markdown
Author

sascgc commented Apr 8, 2026

Tests updated to align with the command-line tool modifications.

Christophe Guerreiro added 14 commits April 9, 2026 14:47
…l and summary filtering options

The following arguments are removed:
- '--summary'
- '--full'
- '--show-added'
- '--show-changed'
- '--show-removed'

The purpose of this tool is to highlight differences between two spdx files.
Built-in filtering adds extra logic that dilutes this goal and overlaps with the
other tools that already provide their own filtering capabilities.

By removing filtering, the tool now focuses on producing a complete and reliable
spdx diff, leaving filtering decisions to users or downstream tooling.

Signed-off-by: Christophe Guerreiro <christophe.guerreiro@non.se.com>
Signed-off-by: Christophe Guerreiro <christophe.guerreiro@non.se.com>
Signed-off-by: Christophe Guerreiro <christophe.guerreiro@non.se.com>
The following filtering category arguments have been renamed and converted to
boolean options, all defaulting to `True`:
- `--show-packages` to `--[no-]packages`
- `--show-config` to `--[no-]kernel-config`
- `--show-packageconfig` to `--[no-]packageconfig`
- `--ignore-proprietary` to `--[no-]packages-proprietary`

Signed-off-by: Christophe Guerreiro <christophe.guerreiro@non.se.com>
The filtering option `--ignore-proprietary` has been renamed to
`--packages-proprietary` and now follows a new boolean behavior:

- `--packages-proprietary` includes proprietary packages (default)
- `--no-packages-proprietary` excludes proprietary packages

Tests have been updated accordingly to reflect this new option and logic.

Signed-off-by: Christophe Guerreiro <christophe.guerreiro@non.se.com>
Signed-off-by: Christophe Guerreiro <christophe.guerreiro@non.se.com>
Added the following new argument:
- `-q`,`--quiet`: enables the quiet mode. Decrease verbosity to ERROR only.

Signed-off-by: Christophe Guerreiro <christophe.guerreiro@non.se.com>
Signed-off-by: Christophe Guerreiro <christophe.guerreiro@non.se.com>
This change ensures that textual output from print_diff are properly separated
from standard output, improving compatibility with tools and pipelines that rely
 on stdout for structured data or program output.

Signed-off-by: Christophe Guerreiro <christophe.guerreiro@non.se.com>
… argument

Previously, the tool was printing human-readable text to stdout and generating a JSON file separately.
This change enforces the presence of an explicit argument used as the JSON output filename.

The console output is now also emitted in JSON format to ensure consistency and
 to simplify integration with automated pipelines and tooling.

Signed-off-by: Christophe Guerreiro <christophe.guerreiro@non.se.com>
Tests have been updated to reflect the new command-line interface.
The previous `--format json --output` options are replaced with the
`--json-output` option, matching the current tool behavior.

Signed-off-by: Christophe Guerreiro <christophe.guerreiro@non.se.com>
…ling

Signed-off-by: Christophe Guerreiro <christophe.guerreiro@non.se.com>
Signed-off-by: Christophe Guerreiro <christophe.guerreiro@non.se.com>
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

Successfully merging this pull request may close these issues.

1 participant