We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
General design optimization (improving efficiency, cleanliness, or developer experience)
Currently, the import statements in the /test contain duplicates and are not consistently ordered. This can lead to:
I will open a pull request after creating this issue.
Follow a structured grouping approach to maintain consistency:
forge-std
solmate
./utils/
../src/types/
../src/interfaces/
../src/libraries/
../src/PoolManager.sol
../src/test/
Within each category, sort imports by the length of the content inside {} (shorter names first).
{}
Before:
import {Test} from "forge-std/Test.sol"; import {Vm} from "forge-std/Vm.sol"; import {PoolId} from "../src/types/PoolId.sol"; import {Hooks} from "../src/libraries/Hooks.sol"; import {IPoolManager} from "../src/interfaces/IPoolManager.sol"; import {IProtocolFees} from "../src/interfaces/IProtocolFees.sol"; import {IHooks} from "../src/interfaces/IHooks.sol"; import {PoolKey} from "../src/types/PoolKey.sol"; import {PoolManager} from "../src/PoolManager.sol"; import {PoolSwapTest} from "../src/test/PoolSwapTest.sol"; import {Deployers} from "./utils/Deployers.sol"; import {Currency} from "../src/types/Currency.sol"; import {MockERC20} from "solmate/src/test/utils/mocks/MockERC20.sol"; import {FullMath} from "../src/libraries/FullMath.sol"; import {BalanceDelta} from "../src/types/BalanceDelta.sol"; import {StateLibrary} from "../src/libraries/StateLibrary.sol";
After (reordered and deduplicated):
import {Test} from "forge-std/Test.sol"; import {Vm} from "forge-std/Vm.sol"; import {MockERC20} from "solmate/src/test/utils/mocks/MockERC20.sol"; import {Deployers} from "./utils/Deployers.sol"; import {PoolId} from "../src/types/PoolId.sol"; import {PoolKey} from "../src/types/PoolKey.sol"; import {Currency} from "../src/types/Currency.sol"; import {BalanceDelta} from "../src/types/BalanceDelta.sol"; import {IHooks} from "../src/interfaces/IHooks.sol"; import {IPoolManager} from "../src/interfaces/IPoolManager.sol"; import {IProtocolFees} from "../src/interfaces/IProtocolFees.sol"; import {Hooks} from "../src/libraries/Hooks.sol"; import {FullMath} from "../src/libraries/FullMath.sol"; import {StateLibrary} from "../src/libraries/StateLibrary.sol"; import {PoolManager} from "../src/PoolManager.sol"; import {PoolSwapTest} from "../src/test/PoolSwapTest.sol";
No response
The text was updated successfully, but these errors were encountered:
PROTO-749 Refactor test file imports by removing duplicates and standardizing order
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Component
General design optimization (improving efficiency, cleanliness, or developer experience)
Describe the suggested feature and problem it solves.
Suggested Feature: Reordering and Deduplicating Imports
Problem
Currently, the import statements in the /test contain duplicates and are not consistently ordered. This can lead to:
Proposed Solution
Benefits
I will open a pull request after creating this issue.
Describe the desired implementation.
Desired Implementation
1. Remove duplicate imports
2. Standardize import order
Follow a structured grouping approach to maintain consistency:
forge-std
,solmate
)./utils/
)../src/types/
)../src/interfaces/
)../src/libraries/
)../src/PoolManager.sol
)../src/test/
)Within each category, sort imports by the length of the content inside
{}
(shorter names first).Example of the new structure
Before:
After (reordered and deduplicated):
Describe alternatives.
No response
Additional context.
No response
The text was updated successfully, but these errors were encountered: