|
7 | 7 | import shutil
|
8 | 8 | import subprocess
|
9 | 9 | from pathlib import Path
|
10 |
| -from typing import TYPE_CHECKING, Dict, List, Optional, Union |
| 10 | +from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union |
11 | 11 |
|
12 | 12 | from crytic_compile.compiler.compiler import CompilerVersion
|
13 | 13 | from crytic_compile.platform.exceptions import InvalidCompilation
|
@@ -36,17 +36,6 @@ class Hardhat(AbstractPlatform):
|
36 | 36 | PROJECT_URL = "https://github.com/nomiclabs/hardhat"
|
37 | 37 | TYPE = Type.HARDHAT
|
38 | 38 |
|
39 |
| - def _settings(self, args): |
40 |
| - hardhat_ignore_compile = args.get("hardhat_ignore_compile", False) or args.get( |
41 |
| - "ignore_compile", False |
42 |
| - ) |
43 |
| - |
44 |
| - base_cmd = ["hardhat"] |
45 |
| - if not args.get("npx_disable", False): |
46 |
| - base_cmd = ["npx"] + base_cmd |
47 |
| - |
48 |
| - return hardhat_ignore_compile, base_cmd |
49 |
| - |
50 | 39 | # pylint: disable=too-many-locals,too-many-statements
|
51 | 40 | def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None:
|
52 | 41 | """Run the compilation
|
@@ -242,6 +231,18 @@ def _guessed_tests(self) -> List[str]:
|
242 | 231 | """
|
243 | 232 | return ["hardhat test"]
|
244 | 233 |
|
| 234 | + @staticmethod |
| 235 | + def _settings(args: Dict[str, Any]) -> Tuple[bool, List[str]]: |
| 236 | + hardhat_ignore_compile = args.get("hardhat_ignore_compile", False) or args.get( |
| 237 | + "ignore_compile", False |
| 238 | + ) |
| 239 | + |
| 240 | + base_cmd = ["hardhat"] |
| 241 | + if not args.get("npx_disable", False): |
| 242 | + base_cmd = ["npx"] + base_cmd |
| 243 | + |
| 244 | + return hardhat_ignore_compile, base_cmd |
| 245 | + |
245 | 246 | def _get_hardhat_paths(
|
246 | 247 | self, base_cmd: List[str], args: Dict[str, str]
|
247 | 248 | ) -> Dict[str, Union[Path, str]]:
|
|
0 commit comments