TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

GoLic, injects license into source code files

28 pointsby kure2567 months ago

7 comments

gtirloni7 months ago
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 months ago
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 months ago
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 months ago
Could use a (2021) in the title. No activity since then in the repo
dangoor7 months ago
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 months ago
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 months ago
There&#x27;s no legal reason to do this.
评论 #41976833 未加载