Git Product home page Git Product logo

license-header-checker's Introduction

Header

Build Status Test Status

Multiplatform command line tool that checks whether the license headers are included in the source files of a project.

  • It can insert the license to a file in case it does not exist (optional).
  • It can replace the license of a file in case it is different (optional).
  • It is possible to choose the file extensions that will be processed.
  • Specific folders, files and paths can be ignored.

DISCLAIMER

The tool expects the software license to be in a block comment at the beginning of the file following the format /* */.

Thus, while it does support the source files of languages like Go, Rust, JavaScript, TypeScript, C, C++, Java, Swift, Kotlin and C#, it does not support the file extensions that do not use this style.

Usage

Syntax

$ license-header-checker [-a] [-r] [-v] [-i path1,...] license-header-path src-path extensions...

Options

  -a        Add the target license in case the file does not have any.
  -r        Replace the existing license by the target one in case they are different.
  -v        Be verbose during execution.
  -i        A comma separated list of the folders, files and/or paths that should be ignored. 
            It does not support wildcards.
  -version  Display version number.

Example

$ license-header-checker -v -a -r -i node_modules,client/assets ../license_header.txt . js ts

Installation

Binary packages

The binary packages for Linux, Windows and macOS are uploaded for each release and can be downloaded from here.

Building from source

The tool has been built with go 1.13.

To build:

$ make build

To install in go/bin:

$ make install

To cross-compile (generate the binaries for Linux, Windows and macOS all at once):

$ make cross-build

To run unit tests:

$ make test

To see unit test coverage:

$ make test-cover

To run end-to-end tests:

$ make test-e2e

license-header-checker's People

Contributors

lluissm avatar wongoo avatar ericzon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.