Skip to content

Add script to annotate composite license rules with required phrases#5118

Open
Kaushik-Kumar-CEG wants to merge 1 commit into
aboutcode-org:developfrom
Kaushik-Kumar-CEG:gsoc/annotate-composite-rules
Open

Add script to annotate composite license rules with required phrases#5118
Kaushik-Kumar-CEG wants to merge 1 commit into
aboutcode-org:developfrom
Kaushik-Kumar-CEG:gsoc/annotate-composite-rules

Conversation

@Kaushik-Kumar-CEG
Copy link
Copy Markdown

@Kaushik-Kumar-CEG Kaushik-Kumar-CEG commented Jun 5, 2026

references #5077

script that adds {{ }} markers to composite (AND/OR) license rules by looking up license names from scancode's index and finding them in rule text

Uses add_required_phrase_to_rule() for injection so all existing validation applies.

Only annotates a rule if ALL licenses in the expression are found in the text. Skips otherwise

Results from dry run: 657/2829 composite rules annotated.

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled and links the original issue above
  • Tests pass
  • Commits are in uniquely-named feature branch and has no merge conflicts

disclosure : used Claude to help review and clean up few bugs in script

Uses scancode license index to find license names in AND/OR rule text and inject {{ }} markers via add_required_phrase_to_rule().

Signed-off-by: Kaushik <kaushikrjpm10@gmail.com>
@Kaushik-Kumar-CEG
Copy link
Copy Markdown
Author

@AyanSinhaMahapatra ready for review when you have a moment

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