Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

adding licence to code

jigsawflux October 4, 2019

Is there a way add some licence text automatically when every source code file when committed to bit bucket ?

1 answer

0 votes
DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 4, 2019

@jigsawfluxI don't think automatically adding license text to every source file when committing is correct way to do this. Reason for this are,

  • This will add change to code after commit,
  • Not all programming language allow adding comment on top of file, e.g. bash, so it require some intelligence while adding license to files.
  • Not all file need license text on top, like license file or readme file in some cases.

 

A better way to achieve this is in your source code editor using License Injectors. There are plugins available for almost all source code editors for this.

Later you can verify license via "Pre Commit Hook" in GIT commit. You can find this article on Medium interesting for this - https://medium.com/cognitio/verify-license-header-before-commit-2eb0c1841121

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events