Skip to content

Commit

Permalink
chore: Adds check for license header (#3203)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
konstantinabl authored Dec 11, 2024
1 parent cc88714 commit b58d891
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
28 changes: 26 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*-
*
* Hedera JSON RPC Relay
*
Expand Down Expand Up @@ -28,7 +28,10 @@ module.exports = {
"plugin:@typescript-eslint/recommended",
"prettier",
],
"plugins": ["simple-import-sort"],
"plugins": [
"simple-import-sort",
"header",
],
"overrides": [
{
"env": {
Expand Down Expand Up @@ -64,5 +67,26 @@ module.exports = {
}],
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "off",
"header/header": [2, "block", [
"-",
" *",
" * Hedera JSON RPC Relay",
" *",
{"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`},
" *",
" * Licensed under the Apache License, Version 2.0 (the \"License\");",
" * you may not use this file except in compliance with the License.",
" * You may obtain a copy of the License at",
" *",
" * http://www.apache.org/licenses/LICENSE-2.0",
" *",
" * Unless required by applicable law or agreed to in writing, software",
" * distributed under the License is distributed on an \"AS IS\" BASIS,",
" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
" * See the License for the specific language governing permissions and",
" * limitations under the License.",
" *",
" ",
]],
},
};
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-standard-with-typescript": "^43.0.1",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
Expand Down

0 comments on commit b58d891

Please sign in to comment.