项目作者: ItsNickBarry

项目描述 :
©️ Prepend local Solidity source files with an SPDX License Identifier 🔨
高级语言: JavaScript
项目地址: git://github.com/ItsNickBarry/hardhat-spdx-license-identifier.git
创建时间: 2020-05-18T01:30:46Z
项目社区:https://github.com/ItsNickBarry/hardhat-spdx-license-identifier

开源协议:MIT License

下载


Hardhat SPDX License Identifier

Prepend Solidity source files in Hardhat projects with the SPDX License Identifier specified in package.json.

Versions of this plugin prior to 2.0.0 were released as buidler-spdx-license-identifier.

Installation

  1. npm install --save-dev hardhat-spdx-license-identifier
  2. # or
  3. yarn add --dev hardhat-spdx-license-identifier

Usage

Load plugin in Hardhat config:

  1. require('hardhat-spdx-license-identifier');

Add configuration under the spdxLicenseIdentifier key:

option description default
overwrite whether to overwrite existing SPDX license identifiers false
runOnCompile whether to automatically prepend identifiers during compilation false
only Array of String matchers used to select included paths, defaults to all contracts if length is 0 []
except Array of String matchers used to exclude paths []
  1. spdxLicenseIdentifier: {
  2. overwrite: true,
  3. runOnCompile: true,
  4. except: ['vendor/']
  5. }

The included Hardhat task may be run manually:

  1. npx hardhat prepend-spdx-license
  2. # or
  3. yarn run hardhat prepend-spdx-license

Files which do not contain a license identifier will be prepended with one. Files with a license identifier which does not match that which is specified in package.json may be updated, depending on configuration.

Development

Install dependencies via Yarn:

  1. yarn install

Setup Husky to format code on commit:

  1. yarn prepare