Skip to content

Commit de19884

Browse files
committed
lint: add ruff linter and fix linter issues
1 parent 7634e6f commit de19884

File tree

7 files changed

+7
-11
lines changed

7 files changed

+7
-11
lines changed

.flake8

Lines changed: 0 additions & 6 deletions
This file was deleted.

examples/get_agents_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
# Return the result
3535
#
3636
if ok:
37-
if not ("files" in res) or len(res["files"]) == 0:
37+
if "files" not in res or len(res["files"]) == 0:
3838
print("No current auto configuration")
3939
else:
4040
print("Current contents of config file:")

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
packages = [
2222
python310 # Minimum supported python version in this project
2323
uv
24+
ruff
2425
];
2526
};
2627

sdcclient/_monitor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import json
22
from typing import Any, Tuple, Union
3+
import re
34

45
from sdcclient._common import _SdcCommon
56
from sdcclient.monitor import EventsClientV2, DashboardsClientV3

sdcclient/monitor/dashboard_converters/_dashboard_versions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ def convert_property_name(prop_name, old_metric, new_metric):
157157
sorted_metrics = []
158158
timestamp_key = [m for m in migrated_metrics
159159
if m['id'] == 'timestamp' and
160-
not ('timeAggregation' in m) or
160+
'timeAggregation' not in m or
161161
not (m['timeAggregation'] is not None)
162162
]
163163
no_timestamp_keys = [m for m in migrated_metrics
164164
if m['id'] != 'timestamp' and
165-
not ('timeAggregation' in m) or
165+
'timeAggregation' not in m or
166166
not (m['timeAggregation'] is not None)
167167
]
168168
values = [m for m in migrated_metrics

specs/monitor/captures_v1_spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from expects import expect, have_key, contain
88
from expects.matchers import _Or
99
from expects.matchers.built_in import have_keys, equal
10-
from mamba import description, it, before, after
10+
from mamba import description, it, before, after, _it
1111

1212
from sdcclient import SdMonitorClient
1313
from specs import be_successful_api_call

utils/sync_pagerduty_policies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def get_integration_map(acc, channel):
173173
# delete all PagerDuty notification channels in Sysdig that do NOT have an integration in PagerDuty
174174
#
175175
for channel in pager_duty_channels:
176-
if not channel['options']['serviceKey'] in service_integration_keys:
176+
if channel['options']['serviceKey'] not in service_integration_keys:
177177
actions.append({
178178
'info': 'Remove notification channel "{}" not connected to any integration'.format(channel['name']),
179179
'fn': actions_factory.delete_notification_channel(channel)

0 commit comments

Comments
 (0)