GithubHelp home page GithubHelp logo

qub1750ul-mirror / deno_license_checker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kt3k/license-checker

0.0 1.0 0.0 60 KB

:page_facing_up: CLI tool for checking license headers in files

License: MIT License

TypeScript 100.00%

deno_license_checker's Introduction

deno_license_checker v2.0.0

Build Status Build status

This tool checks the license headers in the files in a git repository. You can configure which files should have which license texts with .licenserc.json.

Usage

Create .licenserc.json like the following:

{
  "**/*.ts": "// Copyright 2019 My Name. All rights reserved. MIT license."
}

Then run:

deno --allow-read --allow-run https://deno.land/x/[email protected]/main.ts

This checks the license lines in the files in your repository.

.licenserc.json

You can use any glob pattern in the keys of .licenserc.json

{
  "**/*.ts": "Copyright 2019 My Name. All rights reserved. MIT license.",

  "**/*.{js,ts}": "This matches any .js and .ts files",

  "*.go": "This matches .go file in the project root, (not in subdirectories)",

  "src/**/*.ts": "This matches .ts file in `src` dir",

  "**/*.ts": [
    "You can put multiline headers like this",

    "Copyright Foo, Inc. and other Bar contributors."

    "Permission is hereby granted, free of charge, to any person obtaining a"
    "copy of this software and associated documentation files (the",
    "\"Software\"), to deal in the Software without restriction, including",
    "without limitation the rights to use, copy, modify, merge, publish,",
    "distribute, sublicense, and/or sell copies of the Software, and to permit",
    "persons to whom the Software is furnished to do so, subject to the",
    "following conditions:",
    "..."
  ]
}

Ignore certain files

You can ignore certain files by the ignore array in config.

{
  "**/*.js": "// Copyright 2019 My Name. All rights reserved. MIT license.",

  "ignore": [
    "lib/vendor/jquery.js", // ignore this file
    "vendor/" // ignore all files under vendor
  ]
}

Note: ignore needs to be an array, not a string.

Multiple config in .licenserc.json

You can put multiple config in .licenserc.json like the below:

[
  {
    "*.ts": "Copyright main",
    "ignore": [
      "vendor.ts"
    ]
  },
  {
    "vendor.ts": "Copyright some vendor"
  }
]

Each object in the main array is treated independently as a single config. This is useful when the some license lines overlaps the ignore pattern of the other config.

Options

Usage: license_checker.ts [options]

Options:
  -H, --help               Show this help message and exit.
  -V, --version            Show the version number and exit.
  -q, --quiet              Don't print messages except errors.
  -i, --inject             Inject license into head if missing.
  -c, --config <filename>  Specify config filename. Default is '.licenserc.json'.

LICENSE

MIT

See also

History

  • 2019-03-10 v1.5.0 Add --inject flag
  • 2019-03-10 v1.4.0 Update for deno v0.3.x
  • 2019-02-24 v1.3.0 Support Multiline copyright header #3
  • 2019-02-16 v1.2.0 Initial release

deno_license_checker's People

Contributors

kt3k avatar keroxp avatar

Watchers

James Cloos 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.