Skip to content

Commit a08a95e

Browse files
committed
style: fix linting issues
1 parent e75ce9d commit a08a95e

File tree

5 files changed

+49
-16
lines changed

5 files changed

+49
-16
lines changed

dependabot_file.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,12 @@ def build_dependabot_file(
154154
if dependabot_file and dependabot_file[-1] != "\n":
155155
dependabot_file += "\n"
156156
dependabot_file += make_dependabot_config(
157-
manager, group_dependencies, indent, schedule, schedule_day, labels
157+
manager,
158+
group_dependencies,
159+
indent,
160+
schedule,
161+
schedule_day,
162+
labels,
158163
)
159164
break
160165
except github3.exceptions.NotFoundError:
@@ -167,7 +172,12 @@ def build_dependabot_file(
167172
if file[0].endswith(".tf"):
168173
package_managers_found["terraform"] = True
169174
dependabot_file += make_dependabot_config(
170-
"terraform", group_dependencies, indent, schedule, schedule_day, labels
175+
"terraform",
176+
group_dependencies,
177+
indent,
178+
schedule,
179+
schedule_day,
180+
labels,
171181
)
172182
break
173183
except github3.exceptions.NotFoundError:

env.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,7 @@ def get_env_vars(
329329
labels_str = os.getenv("LABELS")
330330
labels_list = []
331331
if labels_str:
332-
labels_list = [
333-
label.lower().strip() for label in labels_str.split(",")
334-
]
332+
labels_list = [label.lower().strip() for label in labels_str.split(",")]
335333

336334
return (
337335
organization,
@@ -358,5 +356,5 @@ def get_env_vars(
358356
repo_specific_exemptions,
359357
schedule,
360358
schedule_day,
361-
labels_list
359+
labels_list,
362360
)

evergreen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def main(): # pragma: no cover
115115
existing_config,
116116
schedule,
117117
schedule_day,
118-
labels
118+
labels,
119119
)
120120

121121
if dependabot_file is None:

test_dependabot_file.py

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# pylint: disable=too-many-public-methods
12
"""Tests for the dependabot_file.py functions."""
23

34
import unittest
@@ -411,7 +412,9 @@ def test_build_dependabot_file_with_exempt_ecosystems(self):
411412
repo = MagicMock()
412413
repo.file_contents.side_effect = lambda filename: filename == "Dockerfile"
413414

414-
result = build_dependabot_file(repo, False, ["docker"], {}, None, "weekly", "", [])
415+
result = build_dependabot_file(
416+
repo, False, ["docker"], {}, None, "weekly", "", []
417+
)
415418
self.assertEqual(result, None)
416419

417420
def test_build_dependabot_file_with_repo_specific_exempt_ecosystems(self):
@@ -487,7 +490,14 @@ def test_build_dependabot_file_for_multiple_repos_with_few_existing_config(self)
487490
interval: 'weekly'
488491
"""
489492
result = build_dependabot_file(
490-
no_existing_config_repo, False, exempt_ecosystems, {}, None, "weekly", "", []
493+
no_existing_config_repo,
494+
False,
495+
exempt_ecosystems,
496+
{},
497+
None,
498+
"weekly",
499+
"",
500+
[],
491501
)
492502
self.assertEqual(result, expected_result)
493503

@@ -527,11 +537,17 @@ def test_check_multiple_repos_with_no_dependabot_config(self):
527537
interval: 'weekly'
528538
"""
529539
result = build_dependabot_file(
530-
no_existing_config_repo, False, exempt_ecosystems, {}, None, "weekly", "", []
540+
no_existing_config_repo,
541+
False,
542+
exempt_ecosystems,
543+
{},
544+
None,
545+
"weekly",
546+
"",
547+
[],
531548
)
532549
self.assertEqual(result, expected_result)
533550

534-
535551
def test_build_dependabot_file_with_label(self):
536552
"""Test that the dependabot.yml file is built correctly with one label set"""
537553
repo = MagicMock()
@@ -574,9 +590,17 @@ def test_build_dependabot_file_with_labels(self):
574590
- "test2"
575591
"""
576592
result = build_dependabot_file(
577-
repo, False, [], {}, None, "weekly", "", ["dependencies", "test1", "test2"]
593+
repo,
594+
False,
595+
[],
596+
{},
597+
None,
598+
"weekly",
599+
"",
600+
["dependencies", "test1", "test2"],
578601
)
579602
self.assertEqual(result, expected_result)
580603

604+
581605
if __name__ == "__main__":
582606
unittest.main()

test_env.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# pylint: disable=too-many-public-methods
1+
# pylint: disable=too-many-public-methods,too-many-lines
22

33
"""Test the get_env_vars function"""
44

@@ -933,7 +933,7 @@ def test_get_env_vars_with_valid_schedule_and_schedule_day(self):
933933
{
934934
"ORGANIZATION": "my_organization",
935935
"GH_TOKEN": "my_token",
936-
"LABELS": "dependencies"
936+
"LABELS": "dependencies",
937937
},
938938
clear=True,
939939
)
@@ -976,7 +976,7 @@ def test_get_env_vars_with_a_valid_label(self):
976976
{
977977
"ORGANIZATION": "my_organization",
978978
"GH_TOKEN": "my_token",
979-
"LABELS": "dependencies, test ,test2 "
979+
"LABELS": "dependencies, test ,test2 ",
980980
},
981981
clear=True,
982982
)
@@ -1009,10 +1009,11 @@ def test_get_env_vars_with_valid_labels_containing_spaces(self):
10091009
{}, # repo_specific_exemptions
10101010
"weekly", # schedule
10111011
"", # schedule_day
1012-
["dependencies", "test" ,"test2"], # labels
1012+
["dependencies", "test", "test2"], # labels
10131013
)
10141014
result = get_env_vars(True)
10151015
self.assertEqual(result, expected_result)
10161016

1017+
10171018
if __name__ == "__main__":
10181019
unittest.main()

0 commit comments

Comments
 (0)