Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add eslint to be run pre commit #3261

Merged
merged 7 commits into from
Nov 15, 2024

Conversation

konstantinabl
Copy link
Collaborator

@konstantinabl konstantinabl commented Nov 14, 2024

Description:

Added the eslint --fix command to lint-staged and husky. This means that whenever a staged file is committed it will be checked by eslint for any broken rules and they will be fixed, if possible. (some rules are not fixable, like unused-vars for example).

Related issue(s):

Fixes #3064

Notes for reviewer:

Note the following things:

  1. eslint.yml file was deleted, since we shouldn't have two eslint config files
  2. There are changes in sdkClient.spec.ts, since eslint --fix was tested on it

Nana-EC
Nana-EC previously approved these changes Nov 14, 2024
Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

…r running pre commit hook

Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
@konstantinabl konstantinabl force-pushed the 3064-add-eslint-to-be-run-pre-commit branch from 0c16cd0 to 4c2bee0 Compare November 14, 2024 20:38
Copy link

sonarcloud bot commented Nov 14, 2024

Copy link
Member

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks for the good work

Copy link

github-actions bot commented Nov 14, 2024

Test Results

    4 files   -  16    420 suites  +163   27s ⏱️ - 32m 56s
1 492 tests +883  1 491 ✅ +889  1 💤  - 3  0 ❌  - 3 
1 501 runs  +797  1 500 ✅ +804  1 💤  - 4  0 ❌  - 3 

Results for commit 4c2bee0. ± Comparison against base commit d1a8fbc.

This pull request removes 609 and adds 1492 tests. Note that renamed tests count towards both.
"before all" hook for "should associate to a token" ‑ RPC Server Acceptance Tests Acceptance tests @tokencreate HTS Precompile Token Create Acceptance Tests "before all" hook for "should associate to a token"
"before all" hook for "should execute "eth_getCode" for hts token" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-2 RPC Server Acceptance Tests eth_getCode "before all" hook for "should execute "eth_getCode" for hts token"
"eth_call" for non-existing contract address returns 0x ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-3 RPC Server Acceptance Tests eth_call "eth_call" for non-existing contract address returns 0x
001 Should call pureMultiply ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-3 RPC Server Acceptance Tests eth_call Caller contract With evm address 001 Should call pureMultiply
001 Should call pureMultiply ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-3 RPC Server Acceptance Tests eth_call Caller contract With long-zero address 001 Should call pureMultiply
002 Should call msgSender ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-3 RPC Server Acceptance Tests eth_call Caller contract With evm address 002 Should call msgSender
002 Should call msgSender ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-3 RPC Server Acceptance Tests eth_call Caller contract With long-zero address 002 Should call msgSender
003 Should call txOrigin ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-3 RPC Server Acceptance Tests eth_call Caller contract With evm address 003 Should call txOrigin
003 Should call txOrigin ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-3 RPC Server Acceptance Tests eth_call Caller contract With long-zero address 003 Should call txOrigin
004 Should call msgSig ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-3 RPC Server Acceptance Tests eth_call Caller contract With evm address 004 Should call msgSig
…
"eth_blockNumber" return the latest block number on second try ‑ @ethGetBlockByNumber using MirrorNode "eth_blockNumber" return the latest block number on second try
"eth_blockNumber" should return the latest block number using cache ‑ @ethGetBlockByNumber using MirrorNode "eth_blockNumber" should return the latest block number using cache
"eth_blockNumber" should return the latest block number ‑ @ethGetBlockByNumber using MirrorNode "eth_blockNumber" should return the latest block number
"eth_blockNumber" should throw an error if no blocks are found after third try ‑ @ethGetBlockByNumber using MirrorNode "eth_blockNumber" should throw an error if no blocks are found after third try
"eth_blockNumber" should throw an error if no blocks are found ‑ @ethGetBlockByNumber using MirrorNode "eth_blockNumber" should throw an error if no blocks are found
Adds a revertReason field for receipts with errorMessage ‑ @ethGetTransactionReceipt eth_getTransactionReceipt tests Adds a revertReason field for receipts with errorMessage
BLOCK_HASH filter timeouts and throws the expected error ‑ @ethGetLogs using MirrorNode timeout BLOCK_HASH filter timeouts and throws the expected error
BLOCK_HASH filter ‑ @ethGetLogs using MirrorNode BLOCK_HASH filter
Can extract the account number out of an account pagination next link url ‑ MirrorNodeClient Can extract the account number out of an account pagination next link url
Can extract the evm address out of an account pagination next link url ‑ MirrorNodeClient Can extract the evm address out of an account pagination next link url
…
This pull request removes 4 skipped tests and adds 1 skipped test. Note that renamed tests count towards both.
011 Should fail when calling msgValue with more value than available balance ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-3 RPC Server Acceptance Tests eth_call Caller contract With evm address 011 Should fail when calling msgValue with more value than available balance
011 Should fail when calling msgValue with more value than available balance ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-3 RPC Server Acceptance Tests eth_call Caller contract With long-zero address 011 Should fail when calling msgValue with more value than available balance
from/to Addresses in transaction to a contract (deployed through HAPI tx) are in evm and long-zero format ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-2 RPC Server Acceptance Tests Formats of addresses in Transaction and Receipt results from/to Addresses in transaction to a contract (deployed through HAPI tx) are in evm and long-zero format
should not return contract bytecode after sefldestruct ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-2 RPC Server Acceptance Tests eth_getCode should not return contract bytecode after sefldestruct
supports optionality of request id when configured ‑ RPC Server given REQUEST_ID_IS_OPTIONAL=true are set supports optionality of request id when configured

♻️ This comment has been updated with latest results.

@konstantinabl konstantinabl added this to the 0.61.0 milestone Nov 15, 2024
@konstantinabl konstantinabl added the Internal For changes that affect the project's internal workings but not its outward-facing functionality. label Nov 15, 2024
@konstantinabl konstantinabl merged commit 51eeeba into main Nov 15, 2024
44 of 48 checks passed
@konstantinabl konstantinabl deleted the 3064-add-eslint-to-be-run-pre-commit branch November 15, 2024 09:16
Copy link

codecov bot commented Nov 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.84%. Comparing base (d1a8fbc) to head (4c2bee0).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3261   +/-   ##
=======================================
  Coverage   77.84%   77.84%           
=======================================
  Files          66       66           
  Lines        4460     4460           
  Branches     1000     1000           
=======================================
  Hits         3472     3472           
  Misses        613      613           
  Partials      375      375           
Flag Coverage Δ
config-service 98.14% <ø> (ø)
relay 78.58% <ø> (ø)
server 83.28% <ø> (ø)
ws-server 36.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

konstantinabl added a commit that referenced this pull request Nov 15, 2024
* Adds linting rules and lint script to all the packages; foundation for running pre commit hook

Signed-off-by: Konstantina Blazhukova <[email protected]>

* Removes license header rule and uninstalls unecessary plugin

Signed-off-by: Konstantina Blazhukova <[email protected]>

* tests

Signed-off-by: Konstantina Blazhukova <[email protected]>

* test import sorting

Signed-off-by: Konstantina Blazhukova <[email protected]>

* Adds trailing comma rule

Signed-off-by: Konstantina Blazhukova <[email protected]>

* remove unecessary test changes from test file

Signed-off-by: Konstantina Blazhukova <[email protected]>

* Removes leftover variable

Signed-off-by: Konstantina Blazhukova <[email protected]>

---------

Signed-off-by: Konstantina Blazhukova <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internal For changes that affect the project's internal workings but not its outward-facing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add eslint to be run pre-commit
4 participants