1313
1414def get_parser ():
1515
16- main_parser = argparse .ArgumentParser (
17- formatter_class = argparse .RawTextHelpFormatter
18- )
16+ main_parser = argparse .ArgumentParser (formatter_class = argparse .RawTextHelpFormatter )
1917
2018 main_parser .add_argument (
2119 "-d" ,
@@ -62,16 +60,16 @@ def get_parser():
6260 main_parser .add_argument (
6361 "-fp" ,
6462 "--format-patch" ,
65- action = ' store_true' ,
63+ action = " store_true" ,
6664 help = "Enable this option, if you want to get the code from the"
67- " previous branch."
65+ " previous branch." ,
6866 )
6967
7068 main_parser .add_argument (
7169 "-rn" ,
7270 "--remote-name" ,
7371 dest = "remote_name" ,
74- default = ' origin' ,
72+ default = " origin" ,
7573 type = str ,
7674 )
7775
@@ -95,22 +93,27 @@ def get_parser():
9593 main_parser .add_argument (
9694 "-nc" ,
9795 "--no-commit" ,
98- action = ' store_true' ,
96+ action = " store_true" ,
9997 default = False ,
10098 help = "Enable this option, if you don't want that the library commits"
101- " the changes. (using git add and git commit command)"
99+ " the changes. (using git add and git commit command)" ,
102100 )
103101
104102 # TODO: Move to `argparse.BooleanOptionalAction` once in Python 3.9+
105103 main_parser .add_argument (
106- "-npc" , "--no-pre-commit" , dest = "pre_commit" , action = "store_false" ,
104+ "-npc" ,
105+ "--no-pre-commit" ,
106+ dest = "pre_commit" ,
107+ action = "store_false" ,
107108 help = "Skip pre-commit execution" ,
108109 )
109110
110111 # TODO: Move to `argparse.BooleanOptionalAction` once in Python 3.9+
111112 main_parser .add_argument (
112- "-nrmf" , "--no-remove-migration-folder" ,
113- dest = "remove_migration_folder" , action = "store_false" ,
113+ "-nrmf" ,
114+ "--no-remove-migration-folder" ,
115+ dest = "remove_migration_folder" ,
116+ action = "store_false" ,
114117 help = "Skip removing migration folder" ,
115118 )
116119
@@ -131,13 +134,22 @@ def main(args=False):
131134
132135 try :
133136 # Create a new Migration Object
134- module_names = args .modules \
135- and [x .strip () for x in args .modules .split ("," ) if x .strip ()] or []
137+ module_names = (
138+ args .modules
139+ and [x .strip () for x in args .modules .split ("," ) if x .strip ()]
140+ or []
141+ )
136142
137143 migration = Migration (
138- args .directory , args .init_version_name , args .target_version_name ,
139- module_names , args .format_patch , args .remote_name ,
140- not args .no_commit , args .pre_commit , args .remove_migration_folder ,
144+ args .directory ,
145+ args .init_version_name ,
146+ args .target_version_name ,
147+ module_names ,
148+ args .format_patch ,
149+ args .remote_name ,
150+ not args .no_commit ,
151+ args .pre_commit ,
152+ args .remove_migration_folder ,
141153 )
142154
143155 # run Migration
0 commit comments