GitXplorerGitXplorer
I

hardhat-spdx-license-identifier

public
19 stars
5 forks
1 issues

Commits

List of commits on branch master.
Verified
68bceec7b6b21c5f24cdd4b0b7d5f6db7b9c069b

Merge pull request #31 from ItsNickBarry/dependabot/npm_and_yarn/cross-spawn-7.0.6

IItsNickBarry committed 2 months ago
Verified
0dc85d5f4251def1bf557cb1f1e05c8f3a6f3e84

Bump cross-spawn from 7.0.3 to 7.0.6

ddependabot[bot] committed 2 months ago
Verified
071c02895de77a363885c474fa5d2f7abd43df3a

Merge pull request #30 from ItsNickBarry/dependabot/npm_and_yarn/secp256k1-4.0.4

IItsNickBarry committed 3 months ago
Verified
6ce319308c161313547652a15578964db97153e7

Bump secp256k1 from 4.0.3 to 4.0.4

ddependabot[bot] committed 3 months ago
Verified
a2f1d1ee024db49a0a7097404f27d41e3a5efc86

Merge pull request #29 from ItsNickBarry/dependabot/npm_and_yarn/micromatch-4.0.8

IItsNickBarry committed 4 months ago
Verified
c5cc52beb1ea06562f22ecee597ed81571308413

Bump micromatch from 4.0.7 to 4.0.8

ddependabot[bot] committed 4 months ago

README

The README file for this repository.

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

npm install --save-dev hardhat-spdx-license-identifier
# or
yarn add --dev hardhat-spdx-license-identifier

Usage

Load plugin in Hardhat config:

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 []
spdxLicenseIdentifier: {
  overwrite: true,
  runOnCompile: true,
  except: ['vendor/']
}

The included Hardhat task may be run manually:

npx hardhat prepend-spdx-license
# or
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:

yarn install

Setup Husky to format code on commit:

yarn prepare