Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itsnickbarry/hardhat-spdx-license-identifier
Šī¸ Prepend local Solidity source files with an SPDX License Identifier đ¨
https://github.com/itsnickbarry/hardhat-spdx-license-identifier
blockchain buidler ethereum hardhat solc solidity spdx-license spdx-licenses wow
Last synced: 10 days ago
JSON representation
Šī¸ Prepend local Solidity source files with an SPDX License Identifier đ¨
- Host: GitHub
- URL: https://github.com/itsnickbarry/hardhat-spdx-license-identifier
- Owner: ItsNickBarry
- License: mit
- Created: 2020-05-18T01:30:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-23T13:41:03.000Z (25 days ago)
- Last Synced: 2024-11-03T13:35:08.120Z (14 days ago)
- Topics: blockchain, buidler, ethereum, hardhat, solc, solidity, spdx-license, spdx-licenses, wow
- Language: TypeScript
- Homepage:
- Size: 287 KB
- Stars: 18
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 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
```bash
npm install --save-dev hardhat-spdx-license-identifier
# or
yarn add --dev hardhat-spdx-license-identifier
```## Usage
Load plugin in Hardhat config:
```javascript
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 | `[]` |```javascript
spdxLicenseIdentifier: {
overwrite: true,
runOnCompile: true,
except: ['vendor/']
}
```The included Hardhat task may be run manually:
```bash
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:
```bash
yarn install
```Setup Husky to format code on commit:
```bash
yarn prepare
```