Description
It would be beneficial to include a copyright check feature in gdlint
. I've already implemented this for my own use case, and it works well. I wanted to create an issue first to see if this is something we would like to have. If so, I will create a PR.
This check will be included in the format_checks. It will be disabled by default but can be enabled if needed. I believe it can be useful for many projects.
Implementation:
In the configuration file, we will define a copyright field as a regular expression.
For example: "copyright": r"#+\s*Copyright © \d{4} My project."
, where \d{4}
represents the year.
In the code, we will check the first line of the .gd
file to ensure the copyright is defined and matches the regular expression.
If year exists, we will also verify that the year is the current year.