Skip to content

Commit befa891

Browse files
committed
[FIX] Apply pre-commit new rules
1 parent 5bc609e commit befa891

File tree

22 files changed

+413
-342
lines changed

22 files changed

+413
-342
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
include requirements.txt
2-
recursive-include odoo_module_migrate/migration_scripts/ *.py *.yaml
2+
recursive-include odoo_module_migrate/migration_scripts/ *.py *.yaml

README.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
odoo-module-migrator
1111
====================
1212

13-
``odoo-module-migrator`` is a python3 library that allows you to automatically migrate
13+
``odoo-module-migrator`` is a python3 library that allows you to automatically migrate
1414
module code to make it compatible with newer Odoo version.
15-
for exemple:
15+
for exemple:
1616

1717
* renaming ``__openerp__.py`` file into ``__manifest__.py``
1818
* removing ``# -*- encoding: utf-8 -*-`` since V11.0
@@ -241,4 +241,3 @@ Contributors
241241
------------
242242

243243
* Sylvain LE GAL (https://www.twitter.com/legalsylvain)
244-

odoo_module_migrate/__main__.py

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313

1414
def 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

Comments
 (0)