Skip to content

Commit b58d891

Browse files
chore: Adds check for license header (#3203)
* Adds check for license header Signed-off-by: Konstantina Blazhukova <[email protected]> * adds new header rule and removes conflict leftover Signed-off-by: Konstantina Blazhukova <[email protected]> * Adds regex for license header Signed-off-by: Konstantina Blazhukova <[email protected]> * finalizes regex for header Signed-off-by: Konstantina Blazhukova <[email protected]> * improves template Signed-off-by: Konstantina Blazhukova <[email protected]> --------- Signed-off-by: Konstantina Blazhukova <[email protected]>
1 parent cc88714 commit b58d891

File tree

3 files changed

+45
-2
lines changed

3 files changed

+45
-2
lines changed

.eslintrc.js

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*-
22
*
33
* Hedera JSON RPC Relay
44
*
@@ -28,7 +28,10 @@ module.exports = {
2828
"plugin:@typescript-eslint/recommended",
2929
"prettier",
3030
],
31-
"plugins": ["simple-import-sort"],
31+
"plugins": [
32+
"simple-import-sort",
33+
"header",
34+
],
3235
"overrides": [
3336
{
3437
"env": {
@@ -64,5 +67,26 @@ module.exports = {
6467
}],
6568
"simple-import-sort/imports": "error",
6669
"simple-import-sort/exports": "off",
70+
"header/header": [2, "block", [
71+
"-",
72+
" *",
73+
" * Hedera JSON RPC Relay",
74+
" *",
75+
{"pattern": "^\\s\\*\\sCopyright \\(C\\) 20(1[8-9]|[2-9]\\d)(?:-20(1[8-9]|[2-9]\\d))? Hedera Hashgraph, LLC$", "template": ` * Copyright (C) ${new Date().getFullYear()} Hedera Hashgraph, LLC`},
76+
" *",
77+
" * Licensed under the Apache License, Version 2.0 (the \"License\");",
78+
" * you may not use this file except in compliance with the License.",
79+
" * You may obtain a copy of the License at",
80+
" *",
81+
" * http://www.apache.org/licenses/LICENSE-2.0",
82+
" *",
83+
" * Unless required by applicable law or agreed to in writing, software",
84+
" * distributed under the License is distributed on an \"AS IS\" BASIS,",
85+
" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
86+
" * See the License for the specific language governing permissions and",
87+
" * limitations under the License.",
88+
" *",
89+
" ",
90+
]],
6791
},
6892
};

package-lock.json

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"eslint-config-airbnb-base": "^15.0.0",
2222
"eslint-config-prettier": "^8.3.0",
2323
"eslint-config-standard-with-typescript": "^43.0.1",
24+
"eslint-plugin-header": "^3.1.1",
2425
"eslint-plugin-import": "^2.28.1",
2526
"eslint-plugin-n": "^15.7.0",
2627
"eslint-plugin-simple-import-sort": "^12.1.1",

0 commit comments

Comments
 (0)