Remove unused imports with solhint plus extra rules (#5661)

This commit is contained in:
Ernesto García
2025-05-07 10:23:49 -06:00
committed by GitHub
parent 6bcc3a470d
commit 4aaf40ac5d
16 changed files with 10 additions and 19 deletions

View File

@ -3,7 +3,6 @@
pragma solidity ^0.8.20;
import {IAuthority} from "./IAuthority.sol";
import {AuthorityUtils} from "./AuthorityUtils.sol";
import {IAccessManager} from "./IAccessManager.sol";
import {IAccessManaged} from "./IAccessManaged.sol";

View File

@ -3,8 +3,6 @@
pragma solidity ^0.8.20;
import {Time} from "../../utils/types/Time.sol";
interface IAccessManager {
/**
* @dev A delayed operation was scheduled.

View File

@ -3,8 +3,6 @@
pragma solidity ^0.8.20;
import {Governor} from "../Governor.sol";
import {SafeCast} from "../../utils/math/SafeCast.sol";
import {Checkpoints} from "../../utils/structs/Checkpoints.sol";
/**
* @dev Extension of {Governor} with a super quorum. Proposals that meet the super quorum (and have a majority of for

View File

@ -5,7 +5,6 @@ pragma solidity ^0.8.20;
import {IGovernor, Governor} from "../Governor.sol";
import {TimelockController} from "../TimelockController.sol";
import {IERC165} from "../../interfaces/IERC165.sol";
import {SafeCast} from "../../utils/math/SafeCast.sol";
/**

View File

@ -6,7 +6,6 @@ pragma solidity ^0.8.20;
import {Governor} from "../Governor.sol";
import {IVotes} from "../utils/IVotes.sol";
import {IERC5805} from "../../interfaces/IERC5805.sol";
import {SafeCast} from "../../utils/math/SafeCast.sol";
import {Time} from "../../utils/types/Time.sol";
/**

View File

@ -3,7 +3,6 @@
pragma solidity ^0.8.20;
import {AccessManager} from "../access/manager/AccessManager.sol";
import {StorageSlot} from "../utils/StorageSlot.sol";
contract AccessManagerMock is AccessManager {
event CalledRestricted(address caller);

View File

@ -1,14 +1,13 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {IGovernor, Governor} from "../../../governance/Governor.sol";
import {Governor} from "../../../governance/Governor.sol";
import {GovernorCountingSimple} from "../../../governance/extensions/GovernorCountingSimple.sol";
import {GovernorVotes} from "../../../governance/extensions/GovernorVotes.sol";
import {GovernorVotesQuorumFraction} from "../../../governance/extensions/GovernorVotesQuorumFraction.sol";
import {GovernorTimelockControl} from "../../../governance/extensions/GovernorTimelockControl.sol";
import {TimelockController} from "../../../governance/TimelockController.sol";
import {IVotes} from "../../../governance/utils/IVotes.sol";
import {IERC165} from "../../../interfaces/IERC165.sol";
contract MyGovernor is
Governor,

View File

@ -5,7 +5,7 @@ pragma solidity ^0.8.20;
import {Governor} from "../../governance/Governor.sol";
import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol";
import {GovernorVotesQuorumFraction} from "../../governance/extensions/GovernorVotesQuorumFraction.sol";
import {GovernorCountingOverridable, VotesExtended} from "../../governance/extensions/GovernorCountingOverridable.sol";
import {GovernorCountingOverridable} from "../../governance/extensions/GovernorCountingOverridable.sol";
abstract contract GovernorCountingOverridableMock is
GovernorSettings,

View File

@ -2,7 +2,7 @@
pragma solidity ^0.8.20;
import {IGovernor, Governor} from "../../governance/Governor.sol";
import {Governor} from "../../governance/Governor.sol";
import {GovernorTimelockControl} from "../../governance/extensions/GovernorTimelockControl.sol";
import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol";
import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol";

View File

@ -2,7 +2,7 @@
pragma solidity ^0.8.20;
import {IGovernor, Governor} from "../../governance/Governor.sol";
import {Governor} from "../../governance/Governor.sol";
import {GovernorTimelockAccess} from "../../governance/extensions/GovernorTimelockAccess.sol";
import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol";
import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol";

View File

@ -2,7 +2,7 @@
pragma solidity ^0.8.20;
import {IGovernor, Governor} from "../../governance/Governor.sol";
import {Governor} from "../../governance/Governor.sol";
import {GovernorTimelockCompound} from "../../governance/extensions/GovernorTimelockCompound.sol";
import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol";
import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol";

View File

@ -2,7 +2,7 @@
pragma solidity ^0.8.20;
import {IGovernor, Governor} from "../../governance/Governor.sol";
import {Governor} from "../../governance/Governor.sol";
import {GovernorTimelockControl} from "../../governance/extensions/GovernorTimelockControl.sol";
import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol";
import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol";

View File

@ -2,8 +2,7 @@
pragma solidity ^0.8.20;
import {IERC20} from "../../interfaces/IERC20.sol";
import {ERC20, ERC1363} from "../../token/ERC20/extensions/ERC1363.sol";
import {ERC1363} from "../../token/ERC20/extensions/ERC1363.sol";
// contract that replicate USDT approval behavior in approveAndCall
abstract contract ERC1363ForceApproveMock is ERC1363 {

View File

@ -2,7 +2,6 @@
pragma solidity ^0.8.20;
import {IERC20, ERC20} from "../../token/ERC20/ERC20.sol";
import {ERC1363} from "../../token/ERC20/extensions/ERC1363.sol";
abstract contract ERC1363NoReturnMock is ERC1363 {

View File

@ -5,6 +5,7 @@ const rules = [
'const-name-snakecase',
'contract-name-capwords',
'event-name-capwords',
'max-states-count',
'explicit-types',
'func-name-mixedcase',
'func-param-name-mixedcase',
@ -17,6 +18,8 @@ const rules = [
'use-forbidden-name',
'var-name-mixedcase',
'visibility-modifier-order',
'interface-starts-with-i',
'duplicated-imports',
...customRules.map(r => `openzeppelin/${r.ruleId}`),
];

View File

@ -5,7 +5,6 @@ pragma solidity ^0.8.20;
import {Test} from "forge-std/Test.sol";
import {P256} from "@openzeppelin/contracts/utils/cryptography/P256.sol";
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {Errors} from "@openzeppelin/contracts/utils/Errors.sol";
contract P256Test is Test {