Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

adding licence to code

jigsawflux
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
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 Champion
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