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

Yarn + solhint #122

Merged
merged 3 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ broadcast/
cache/
out/
lcov.info

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
39 changes: 39 additions & 0 deletions .yarn/patches/solhint-npm-4.5.2-10dbd0e73b.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git a/solhint.js b/solhint.js
index 755a910c9c084d027520a73b7b989b9b7912a975..53d912394404ee6bc0a4f283da9ee145f1f73d76 100755
--- a/solhint.js
+++ b/solhint.js
@@ -160,8 +160,7 @@ function executeMainActionLogic() {

printReports(reports, formatterFn)

- // exitWithCode(reports)
- process.exit(0)
+ exitWithCode(reports)
}

function processStdin(options) {
@@ -182,8 +181,7 @@ function processStdin(options) {
const reports = [report]

printReports(reports, formatterFn)
- process.exit(0)
- // exitWithCode(reports)
+ exitWithCode(reports)
}

function writeSampleConfigFile() {
@@ -363,10 +361,10 @@ function listRules() {
}
}

-// function exitWithCode(reports) {
-// const errorsCount = reports.reduce((acc, i) => acc + i.errorCount, 0)
-// process.exit(errorsCount > 0 ? 1 : 0)
-// }
+function exitWithCode(reports) {
+ const errorsCount = reports.reduce((acc, i) => acc + i.errorCount, 0)
+ process.exit(errorsCount > 0 ? 1 : 0)
+}

function checkForUpdate() {
// eslint-disable-next-line import/no-extraneous-dependencies
893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.1.1.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.1.1.cjs
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@
"lint-staged": "^14.0.1",
"prettier": "^3.0.3",
"prettier-plugin-solidity": "^1.1.3",
"solhint": "^4.5.2",
"solhint": "patch:solhint@npm%3A4.5.2#~/.yarn/patches/solhint-npm-4.5.2-10dbd0e73b.patch",
"solhint-plugin-lido-csm": "https://github.com/lidofinance/solhint-plugin-lido-csm.git#0.3.2"
},
"lint-staged": {
"*": "prettier --ignore-unknown --write",
"src/**/*.sol": "solhint"
},
"packageManager": "yarn@4.1.1",
"resolutions": {
"solhint@npm:4.5.2": "patch:solhint@npm%3A4.5.2#~/.yarn/patches/solhint-npm-4.5.2-10dbd0e73b.patch"
}
}
10 changes: 5 additions & 5 deletions src/CSAccounting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -622,11 +622,6 @@ contract CSAccounting is
AssetRecovererLib.recoverStETHShares(address(LIDO), shares);
}

modifier onlyRecoverer() override {
_checkRole(RECOVERER_ROLE);
_;
}

function _getActiveKeys(
uint256 nodeOperatorId
) internal view returns (uint256) {
Expand Down Expand Up @@ -660,4 +655,9 @@ contract CSAccounting is
}
_;
}

modifier onlyRecoverer() override {
_checkRole(RECOVERER_ROLE);
_;
}
}
10 changes: 5 additions & 5 deletions src/CSModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
error MaxSigningKeysCountExceeded();
}

contract CSModule is

Check warning on line 130 in src/CSModule.sol

View workflow job for this annotation

GitHub Actions / Linters

Contract has 18 states declarations but allowed no more than 15
ICSModule,
CSModuleBase,
AccessControl,
Expand Down Expand Up @@ -1093,7 +1093,7 @@
function onExitedAndStuckValidatorsCountsUpdated()
external
onlyRole(STAKING_ROUTER_ROLE)
{

Check warning on line 1096 in src/CSModule.sol

View workflow job for this annotation

GitHub Actions / Linters

Code contains empty blocks
// Nothing to do, rewards are distributed by a performance oracle.
}

Expand Down Expand Up @@ -1675,11 +1675,6 @@
);
}

modifier onlyRecoverer() override {
_checkRole(RECOVERER_ROLE);
_;
}

function _incrementModuleNonce() internal {
_nonce++;
}
Expand Down Expand Up @@ -1725,4 +1720,9 @@
revert NodeOperatorDoesNotExist();
_;
}

modifier onlyRecoverer() override {
_checkRole(RECOVERER_ROLE);
_;
}
}
Loading
Loading