Skip to content

Commit

Permalink
Add # dipdup: ignore at the beginning of type module to ignore it o…
Browse files Browse the repository at this point in the history
…n init (#82)
  • Loading branch information
droserasprout authored Jul 8, 2021
1 parent fb51827 commit 1199414
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/dipdup/codegen.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import logging
import os
import re
import subprocess
from contextlib import suppress
from copy import copy
Expand Down Expand Up @@ -237,6 +238,12 @@ async def generate_types(self) -> None:
input_path = join(root, file)
output_path = join(types_root, f'{pascal_to_snake(name)}.py')

if exists(output_path):
with open(output_path) as type_file:
first_line = type_file.readline()
if re.match(r'^#\s+dipdup:\s+ignore\s*', first_line):
continue

if name == 'storage':
name = '_'.join([root.split('/')[-1], name])
if root.split('/')[-1] == 'parameter':
Expand Down

0 comments on commit 1199414

Please sign in to comment.