Skip to content

Commit

Permalink
build: update solhint wonderland plugin (#221)
Browse files Browse the repository at this point in the history
* build: update wonderland solhint plugin

* fix: yarn lint command

* style: fix the order of members in `IOracle`

* style: unused import

* style: unused imports
  • Loading branch information
gas1cent authored Oct 12, 2023
1 parent 3b98466 commit 74236c0
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 30 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"docs:build": "./build-docs.sh",
"docs:run": "mdbook serve docs",
"postinstall": "husky install",
"lint:check": "yarn lint:sol-tests && yarn lint:sol-logic && forge fmt check",
"lint:check": "yarn lint:sol-tests && yarn lint:sol-logic && forge fmt --check",
"lint:fix": "sort-package-json && forge fmt && yarn lint:sol-tests --fix && yarn lint:sol-logic --fix",
"lint:sol-logic": "solhint 'solidity/contracts/**/*.sol' 'solidity/interfaces/**/*.sol'",
"lint:sol-tests": "solhint -c .solhint.tests.json 'solidity/test/**/*.sol'",
Expand Down Expand Up @@ -56,7 +56,7 @@
"lint-staged": "13.2.2",
"pinst": "3.0.0",
"solhint": "3.5.1",
"solhint-plugin-defi-wonderland": "1.1.0",
"solhint-plugin-defi-wonderland": "1.1.2",
"solidity-docgen": "0.6.0-beta.35",
"sort-package-json": "2.4.1",
"standard-version": "9.5.0",
Expand Down
32 changes: 16 additions & 16 deletions solidity/interfaces/IOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,22 @@ interface IOracle {
*/
error Oracle_CannotTamperParticipant();

/*///////////////////////////////////////////////////////////////
ENUMS
//////////////////////////////////////////////////////////////*/

/**
* @notice All available statuses a dispute can have
*/
enum DisputeStatus {
None,
Active,
Escalated,
Won,
Lost,
NoResolution
}

/*///////////////////////////////////////////////////////////////
STRUCTS
//////////////////////////////////////////////////////////////*/
Expand Down Expand Up @@ -293,22 +309,6 @@ interface IOracle {
DisputeStatus status;
}

/*///////////////////////////////////////////////////////////////
ENUMS
//////////////////////////////////////////////////////////////*/

/**
* @notice All available statuses a dispute can have
*/
enum DisputeStatus {
None,
Active,
Escalated,
Won,
Lost,
NoResolution
}

/*///////////////////////////////////////////////////////////////
VARIABLES
//////////////////////////////////////////////////////////////*/
Expand Down
4 changes: 2 additions & 2 deletions solidity/test/integration/IntegrationBase.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

// solhint-disable no-unused-import
// solhint-disable-next-line no-console
import {console} from 'forge-std/console.sol';

/* solhint-disable no-unused-import */
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import {DSTestPlus} from '@defi-wonderland/solidity-utils/solidity/test/DSTestPlus.sol';
import {Helpers} from '../utils/Helpers.sol';
Expand All @@ -26,7 +26,7 @@ import {MockResolutionModule, IMockResolutionModule} from '../mocks/contracts/Mo
import {MockFinalityModule, IMockFinalityModule} from '../mocks/contracts/MockFinalityModule.sol';

import {TestConstants} from '../utils/TestConstants.sol';
/* solhint-enable no-unused-import */
// solhint-enable no-unused-import

contract IntegrationBase is DSTestPlus, TestConstants, Helpers {
uint256 public constant FORK_BLOCK = 756_611;
Expand Down
2 changes: 1 addition & 1 deletion solidity/test/mocks/contracts/MockAccounting.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {IMockAccounting, IERC20} from '../interfaces/IMockAccounting.sol';
import {IMockAccounting} from '../interfaces/IMockAccounting.sol';

contract MockAccounting is IMockAccounting {}
2 changes: 0 additions & 2 deletions solidity/test/mocks/interfaces/IMockAccounting.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';

interface IMockAccounting {}
3 changes: 0 additions & 3 deletions solidity/test/utils/Helpers.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import {DSTestPlus} from '@defi-wonderland/solidity-utils/solidity/test/DSTestPlus.sol';

import {IOracle} from '../../contracts/Oracle.sol';
import {IMockAccounting} from '../mocks/interfaces/IMockAccounting.sol';

contract Helpers is DSTestPlus {
function _getMockDispute(
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2779,10 +2779,10 @@ slice-ansi@^5.0.0:
ansi-styles "^6.0.0"
is-fullwidth-code-point "^4.0.0"

[email protected].0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/solhint-plugin-defi-wonderland/-/solhint-plugin-defi-wonderland-1.1.0.tgz#6b82ee4da9fea1a4aeed4409915c3980f0f6b6a2"
integrity sha512-dl5wyURqrs9KgkDjYDW5RN55Fij7rrtybluqG45csilqD9x2vd+iAkaMD2VU150TqmfrcYN5p1Rer3sKWRNIPQ==
[email protected].2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/solhint-plugin-defi-wonderland/-/solhint-plugin-defi-wonderland-1.1.2.tgz#9bb26e173dd14c23eb28d107dd5ee21953ce0d5e"
integrity sha512-LkszaY3JwTpnWPRWTjPVzemMl+2LSw64Xd0wOE3dmPvBsELfvPo659zfQexLfxEtuubfuA33rw5WQw0LBC2alA==
dependencies:
solhint "3.3.7"

Expand Down

0 comments on commit 74236c0

Please sign in to comment.