Add Lint check to ensure all .java files have Copyright Headers
With more new contributors, we should automate ensuring that each new file has a copyright header, rather than leaving this to code review.
We can do this via a lint check. For example: https://github.com/ankidroid/Anki-Android/blob/db82ab008a90ff89e77c5c5637b2e33be17ab04a/lint-rules/src/main/java/com/ichi2/anki/lint/rules/InconsistentAnnotationUsage.java
It would be ideal if the lint check guided users to the correct setting screen in Android Studio to set up the copyright:
This can be done via an explanation: https://github.com/ankidroid/Anki-Android/blob/db82ab008a90ff89e77c5c5637b2e33be17ab04a/lint-rules/src/main/java/com/ichi2/anki/lint/rules/InconsistentAnnotationUsage.java#L37-L39

It may also be useful to provide users with a template:
Copyright (c) $today.year Your Name Here <[email protected]>
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
Please note that this functionality may already exist in Android Studio's suite of lint tools, and we should confirm that this isn't the case before writing our own code.
Can I work on this?
I want to work on this
Sorry @imaryandokania, I'll go with @ChaxuGarg as he commented first.
Normally we don't have two people going for the same issue - it's a nice problem to have
Sorry @imaryandokania, I'll go with @ChaxuGarg as he commented first.
Normally we don't have two people going for the same issue - it's a nice problem to have
No problem 😀
Hi @ChaxuGarg are you working on this? If not I would like to work on.
Please note that this functionality may already exist in Android Studio's suite of lint tools, and we should confirm that this isn't the case before writing our own code.
There doesn't seem to exist any lint check on this , regarding copyrights there is only one lint check which suggests to convert (c) to copyright symbol
Hi @ChaxuGarg are you working on this? If not I would like to work on.
I haven't started working on it yet, so sure @almas33 go ahead
Please note that this functionality may already exist in Android Studio's suite of lint tools, and we should confirm that this isn't the case before writing our own code.
There doesn't seem to exist any lint check on this , regarding copyrights there is only one lint check which suggests to convert (c) to copyright symbol
We can write our own if one doesn't exist: https://github.com/ankidroid/Anki-Android/pull/7707
IntelliJ Template:
Copyright (c) $today.year Your Name Here <[email protected]>
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically