TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

GoLic, injects license into source code files

28 点作者 kure2567 个月前

7 条评论

gtirloni7 个月前
I&#x27;ve opted to simply add the SPDX license identifier [0] , just like it&#x27;s done in the Linux kernel [1]<p>[0] <a href="https:&#x2F;&#x2F;spdx.org&#x2F;licenses&#x2F;" rel="nofollow">https:&#x2F;&#x2F;spdx.org&#x2F;licenses&#x2F;</a><p>[1] <a href="https:&#x2F;&#x2F;git.kernel.org&#x2F;pub&#x2F;scm&#x2F;linux&#x2F;kernel&#x2F;git&#x2F;torvalds&#x2F;linux.git&#x2F;tree&#x2F;kernel&#x2F;async.c?h=v6.12-rc5#n1" rel="nofollow">https:&#x2F;&#x2F;git.kernel.org&#x2F;pub&#x2F;scm&#x2F;linux&#x2F;kernel&#x2F;git&#x2F;torvalds&#x2F;lin...</a>
jchw7 个月前
Neat. There&#x27;s a lot of hand rolled implementations of this idea, would be nice to have something to standardize on. I am sure it can be done with custom templates but a good idea IMO might be supporting declarations using SPDX IDs. You see them in some source code, e.g. KDE source code. More info here:<p><a href="https:&#x2F;&#x2F;spdx.dev&#x2F;learn&#x2F;handling-license-info&#x2F;" rel="nofollow">https:&#x2F;&#x2F;spdx.dev&#x2F;learn&#x2F;handling-license-info&#x2F;</a><p>For anyone wondering if this (license information in source files) is necessary, I think the answer is &quot;maybe&quot;. Some licenses (e.g. Apache 2) seem to be written such that the license itself requires the disclaimer, and even having copyright information (e.g. users that make substantial contribution adding the name of whoever is assigned the copyright for their contribution to the header) is a good idea. I used to be against this for aesthetic reasons, viewing it somewhat similarly to those annoying corporate email footers, but over time it&#x27;s become more obvious to me that it not only is great for keeping the license very explicit everywhere but may also be legally a good idea. (IANAL.)
评论 #41973235 未加载
评论 #41972932 未加载
评论 #41972340 未加载
Ferret74467 个月前
This could be done with a shell one-liner IIUC.<p>Aside: what is with the contemporary obsession with injecting emojis into everything? If I wanted a picture book, well, I&#x27;d go read a picture book.
JamesCoyne7 个月前
Could use a (2021) in the title. No activity since then in the repo
dangoor7 个月前
Ideally, this would follow the format of reuse.software so that there&#x27;s a machine-readable standard for these: <a href="https:&#x2F;&#x2F;reuse.software" rel="nofollow">https:&#x2F;&#x2F;reuse.software</a><p>I&#x27;m working on tooling that involves automated reading of this info, and it&#x27;s a lot easier if the tools don&#x27;t have to do fuzzier matching.
zoezoezoezoe7 个月前
I like this idea, but with a project with two or more source code files, I would prefer an SPDX identifier, or just rely on the license file in the project directory, licenses at the top of sources IMO should only be for single file&#x2F;header libraries.
IshKebab7 个月前
There&#x27;s no legal reason to do this.
评论 #41976833 未加载