Skip to content

Commit afc32da

Browse files
committed
hacking: Fix typos
0 != O. Change-Id: Iea443da7e802607081150c52d38be2f28293a969 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
1 parent a8d7f64 commit afc32da

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

hacking/checks.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ def assert_no_oslo(logical_line):
3232
3333
O400
3434
"""
35-
if re.match(r'(from|import) oslo_.*', logical_line):
36-
yield (0, "0400: oslo libraries should not be used in SDK projects")
35+
if match := re.match(r'(from|import) (oslo_.*)', logical_line):
36+
if match.group(2) == 'oslo_i18n':
37+
return
38+
yield (0, "O400: oslo libraries should not be used in SDK projects")
3739

3840

3941
@core.flake8ext
@@ -86,7 +88,7 @@ def assert_use_of_client_aliases(logical_line):
8688
logical_line,
8789
):
8890
service = match.group(1)
89-
yield (0, f"0402: prefer {service}_client to sdk_connection.{service}")
91+
yield (0, f"O402: prefer {service}_client to sdk_connection.{service}")
9092

9193
if match := re.match(
9294
r'(self\.app\.client_manager\.(compute|network|image)+\.[a-z_]+) = mock.Mock', # noqa: E501

0 commit comments

Comments
 (0)