Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
z80dev committed Oct 24, 2023
1 parent f0b9533 commit 145d376
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ape_vyper/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ def get_version_pragma_spec(source: Union[str, Path]) -> Optional[SpecifierSet]:
pragma_match = next(re.finditer(r"(?:\n|^)\s*#\s*@version\s*([^\n]*)", source_str), None)
if pragma_match is None:
# support new pragma syntax
pragma_match = next(re.finditer(r"(?:\n|^)\s*#pragma\s+version\s*([^\n]*)", source_str), None)
pragma_match = next(
re.finditer(r"(?:\n|^)\s*#pragma\s+version\s*([^\n]*)", source_str), None
)
if pragma_match is None:
return None # Try compiling with latest

Expand All @@ -97,6 +99,7 @@ def get_version_pragma_spec(source: Union[str, Path]) -> Optional[SpecifierSet]:
logger.warning(f"Invalid pragma spec: '{raw_pragma}'. Trying latest.")
return None


def get_optimization_pragma(source: Union[str, Path]) -> Optional[str | bool]:
"""
Extracts optimization pragma information from Vyper source code.
Expand All @@ -113,7 +116,6 @@ def get_optimization_pragma(source: Union[str, Path]) -> Optional[str | bool]:
return pragma_match.groups()[0]



class VyperCompiler(CompilerAPI):
@property
def config(self) -> VyperConfig:
Expand Down

0 comments on commit 145d376

Please sign in to comment.