aboutcode-org / aboutcode-org/scancode-toolkit

License boilerplate remover plugin

未關閉
#833 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
copyright scan enhancement license scan nice to have
主要語言
Python
星號
2.6k
分支
791
平均合併
1 天 12 小時
30 天內合併 PR
5

描述

This idea of this plugin is to help remove license boilerplate from source code and replace it with an SPDX-License-Identifer expression tag.

This could be called espeedixfy or some better name.
It would be a postscan plugin requiring license detection. Then if there is a clear, 100% match license all matched to SPDX ids (for now), it would remove the matched text from the file and replaces it smartly with an SPDX-License-Identifier handling (by lexing the code) the proper comment style to inject this.
Anyone could run it on their code, and submit patches to clean up the boilerplate e.g something that makes it easy on maintainers to clean the stuff at their own pace. Linux kernel maintainers have expressed interest for this:
>a tool/script like that would be wonderful.

As an option it could also normalize the copyright statements and create a license text file for the doc if it does not exists there.

There is not much left to get there as scancode spits the exact matched text and lines. So from that we can remove the lines from the scanned source code and determine the comment style then inject the license id , possibly using Pygments to determine and preserve the comment style

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。