qe-compiler icon indicating copy to clipboard operation
qe-compiler copied to clipboard

Enforce copyright notices at pre-commit or CI level

Open jgsogo opened this issue 2 years ago • 1 comments

From https://github.com/Qiskit/qss-compiler/pull/63#issuecomment-1460387391

Every source file needs to have a copyright notice in the first lines. When changing a file, we have to update this copyright notice with the year it was last modified. Of course it can happen at most once every year for each file.... however many contributors (and reviewers) might forget about it.

Is there anything we can do as a pre-commit hook or CI level to check that these notes are updated?

cc/ @taalexander

jgsogo avatar Mar 09 '23 10:03 jgsogo

You can adapt this script and run it as part of a ci job https://github.com/Qiskit/qiskit-terra/blob/main/tools/verify_headers.py that will error if a source file is missing the appropriate header

mtreinish avatar Mar 09 '23 11:03 mtreinish