Skip to content

Commit 44582ce

Browse files
williexutjprescott
authored andcommitted
Flake8 (Azure#7695)
* ignore line break after binary operator * fixed local variable never used * faulty escape sequence
1 parent 0241d78 commit 44582ce

File tree

7 files changed

+9
-8
lines changed

7 files changed

+9
-8
lines changed

Diff for: .flake8

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ignore =
77
F401, # imported but unused, too many violations, to be removed in the future
88
F811, # redefinition of unused, to be removed in the future
99
C901 # code flow is too complex, too many violations, to be removed in the future
10+
W504 # line break after binary operator effect on readability is subjective
1011
exclude =
1112
azure_bdist_wheel.py
1213
build

Diff for: bin/extract-loc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
for path in ROOT.rglob('*.py'):
2828
with open(str(path), 'r', encoding='utf-8') as f:
2929
content = f.read()
30-
for m in re.finditer('[^\w_]_\(("(.+)"|\'(.+)\')\)', content):
30+
for m in re.finditer(r'[^\w_]_\(("(.+)"|\'(.+)\')\)', content):
3131
print('# From', path, ':', m.span()[0], file=f_out)
3232
print('KEY:', m.group(2) or m.group(3), file=f_out)
3333
print(m.group(2) or m.group(3), file=f_out)

Diff for: src/azure-cli-core/azure/cli/core/commands/arm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ def handler(args):
644644
raise
645645
else:
646646
raise
647-
except Exception as ex: # pylint: disable=broad-except
647+
except Exception: # pylint: disable=broad-except
648648
progress_indicator.stop()
649649
raise
650650

Diff for: src/command_modules/azure-cli-eventgrid/azure/cli/command_modules/eventgrid/tests/latest/test_eventgrid_commands.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def __init__(self):
1515
self.event_subscription_base_endpoint = "https://eventgridclilivetest.azurewebsites.net/api/HttpTriggerCSharp1"
1616
try:
1717
self.event_subscription_endpoint = os.environ['A01_EVENTGRID_ENDPOINT']
18-
except Exception as e:
18+
except Exception:
1919
self.event_subscription_endpoint = self.event_subscription_sanitized_endpoint
2020

2121

Diff for: src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/validators.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def _validate_weekly_recurrence(namespace):
6161
namespace.recurrence = valid_recurrence[delimiter]['validator'](namespace)
6262
except CLIError as ex:
6363
raise CLIError('{} invalid usage: {}'.format(ex, usage))
64-
except KeyError as ex:
64+
except KeyError:
6565
raise CLIError('invalid usage: -r {{{}}} [ARG ARG ...]'.format(','.join(valid_recurrence)))
6666

6767

Diff for: src/command_modules/azure-cli-resource/azure/cli/command_modules/resource/tests/2017_03_09_profile/test_resource.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ def test_managedappdef(self, resource_group):
597597
'adn': self.create_random_name('testappdefname', 20),
598598
'addn': self.create_random_name('test_appdef', 20),
599599
'ad_desc': 'test_appdef_123',
600-
'uri': 'https:\/\/testclinew.blob.core.windows.net\/files\/vivekMAD.zip',
600+
'uri': 'https://testclinew.blob.core.windows.net/files/vivekMAD.zip',
601601
'auth': '5e91139a-c94b-462e-a6ff-1ee95e8aac07:8e3af657-a8ff-443c-a75c-2fe8c4bcb635',
602602
'lock': 'None'
603603
})
@@ -690,7 +690,7 @@ def test_managedapp(self, resource_group):
690690
'adn': 'testappdefname',
691691
'addn': 'test_appdef_123',
692692
'ad_desc': 'test_appdef_123',
693-
'uri': 'https:\/\/wud.blob.core.windows.net\/appliance\/SingleStorageAccount.zip',
693+
'uri': 'https://wud.blob.core.windows.net/appliance/SingleStorageAccount.zip',
694694
'auth': '5e91139a-c94b-462e-a6ff-1ee95e8aac07:8e3af657-a8ff-443c-a75c-2fe8c4bcb635',
695695
'lock': 'None',
696696
'sub': self.get_subscription_id()

Diff for: src/command_modules/azure-cli-resource/azure/cli/command_modules/resource/tests/latest/test_resource.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ def test_managedappdef(self, resource_group):
740740
'adn': self.create_random_name('testappdefname', 20),
741741
'addn': self.create_random_name('test_appdef', 20),
742742
'ad_desc': 'test_appdef_123',
743-
'uri': 'https:\/\/testclinew.blob.core.windows.net\/files\/vivekMAD.zip',
743+
'uri': 'https://testclinew.blob.core.windows.net/files/vivekMAD.zip',
744744
'auth': '5e91139a-c94b-462e-a6ff-1ee95e8aac07:8e3af657-a8ff-443c-a75c-2fe8c4bcb635',
745745
'lock': 'None'
746746
})
@@ -833,7 +833,7 @@ def test_managedapp(self, resource_group):
833833
'adn': 'testappdefname',
834834
'addn': 'test_appdef_123',
835835
'ad_desc': 'test_appdef_123',
836-
'uri': 'https:\/\/wud.blob.core.windows.net\/appliance\/SingleStorageAccount.zip',
836+
'uri': 'https://wud.blob.core.windows.net/appliance/SingleStorageAccount.zip',
837837
'auth': '5e91139a-c94b-462e-a6ff-1ee95e8aac07:8e3af657-a8ff-443c-a75c-2fe8c4bcb635',
838838
'lock': 'None',
839839
'sub': self.get_subscription_id()

0 commit comments

Comments
 (0)