On Thu, 8 May 2025 at 18:01, Daniel P. Berrangé <berra...@redhat.com> wrote: > > The new attempt at detecting missing SPDX-License-Identifier in > new files is using the following logic > > * When seeing a line starting 'diff --git ...' it indicates > the start of a file in the patch. This must trigger reporting > of violations in the previous file (if any). > > It must reset the validation state, since this may now be a > pre-existing file being changed. This will be resolved by > the next rule. > > * When seeing a line starting 'new file mode...' it indicates > a newly created file and must enable SPDX validation. > > * When seeing EOF, it must trigger reporting of violations in > the last new file in the patch, if any.
> +# All new files should have a SPDX-License-Identifier tag > + if ($line =~ /^diff --git/) { > + # Start of file diff marker, report last file if it failed > + # SPDX validation > + if (defined $expect_spdx_file) { > + &check_spdx_present($expect_spdx_file); > + } > + Forgot to mention, but our perl coding style in this file seems to be generally not to use the & sigil when making function calls. -- PMM