Merge ~emitorino/review-tools:fix/black_format_updates into review-tools:master

Proposed by Emilia Torino
Status: Merged
Merged at revision: 7d79dd093fe085292ddfa67de7bb3d5a1c26db18
Proposed branch: ~emitorino/review-tools:fix/black_format_updates
Merge into: review-tools:master
Diff against target: 87 lines (+12/-11)
2 files modified
reviewtools/sr_common.py (+6/-5)
reviewtools/tests/test_sr_declaration.py (+6/-6)
Reviewer Review Type Date Requested Status
Jamie Strandboge (community) Approve
Review via email: mp+389755@code.launchpad.net

Commit message

Fixing black format issues

Description of the change

-reviewtools/sr_common.py: reformatting code using black
-reviewtools/tests/test_sr_declaration.py: reformatting code using black

To post a comment you must log in.
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Huh, what version of black are you using? I'm getting different results here...

review: Needs Information
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

We discussed this on mattermost. The difference is coming from Emi using pip installed black and me using distro installed black (focal). We decided to use black from beta instead. Note, black is run as part of snap builds (which will use black from the archive), but its use is informational in those builds.

Feel free to update as needed for black in beta and commit.

review: Approve
Revision history for this message
Alex Murray (alexmurray) wrote :

Jamie, to clarify - when you say 'black from beta' do you mean the beta channel of https://snapcraft.io/black ?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/reviewtools/sr_common.py b/reviewtools/sr_common.py
2index 8968caf..a0a4cf9 100644
3--- a/reviewtools/sr_common.py
4+++ b/reviewtools/sr_common.py
5@@ -303,8 +303,8 @@ class SnapReview(Review):
6 }
7
8 interfaces_needing_reference_checks = [
9- 'personal-files',
10- 'system-files',
11+ "personal-files",
12+ "system-files",
13 ]
14
15 # most are from cmd/snap-confine/mount-support.c:sc_populate_mount_ns()
16@@ -365,9 +365,10 @@ class SnapReview(Review):
17 except Exception: # pragma: nocover
18 error("Could not load snap/manifest.yaml. Is it properly " "formatted?")
19
20- self.base_declaration_series, self.base_declaration = (
21- read_snapd_base_declaration()
22- )
23+ (
24+ self.base_declaration_series,
25+ self.base_declaration,
26+ ) = read_snapd_base_declaration()
27
28 # Add in-progress interfaces
29 if self.base_declaration_series in self.inprogress_interfaces:
30diff --git a/reviewtools/tests/test_sr_declaration.py b/reviewtools/tests/test_sr_declaration.py
31index 859458c..12f936b 100644
32--- a/reviewtools/tests/test_sr_declaration.py
33+++ b/reviewtools/tests/test_sr_declaration.py
34@@ -1306,7 +1306,7 @@ slots:
35 self.check_results(r, expected=expected)
36
37 def test__verify_declaration_invalid_slots_iface_constraint_slot_names_value_auto(
38- self
39+ self,
40 ):
41 """Test _verify_declaration - invalid interface constraint slot-names
42 (auto-connection)"""
43@@ -1356,7 +1356,7 @@ slots:
44 self.check_results(r, expected_counts)
45
46 def test__verify_declaration_valid_plugs_iface_constraint_plug_names_value_auto(
47- self
48+ self,
49 ):
50 """Test _verify_declaration - valid interface constraint plug-names
51 (auto-connection)"""
52@@ -1453,7 +1453,7 @@ slots:
53 self.check_results(r, expected=expected)
54
55 def test__verify_declaration_invalid_slots_plug_attribs_browser_support_nonexistent(
56- self
57+ self,
58 ):
59 """Test _verify_declaration - invalid interface constraint attrib
60 nonexistent"""
61@@ -3273,7 +3273,7 @@ slots:
62 self.check_results(r, expected=expected)
63
64 def test_check_declaration_personal_files_alt_regex_match_unmatching_plug_names(
65- self
66+ self,
67 ):
68 """Test check_declaration - personal-files - alternates regex match (unmatching plug-names)"""
69 plugs = {
70@@ -3585,7 +3585,7 @@ slots:
71 self.check_results(r, expected=expected)
72
73 def test_check_declaration_slots_deny_connection_attrib_list_match_matching_plug_names(
74- self
75+ self,
76 ):
77 """Test check_declaration - slots/deny-connection/attrib - list match snap attribute str in decl list (matching plug-names)"""
78 slots = {"iface-foo": {"interface": "foo", "attrib1": "b"}}
79@@ -3618,7 +3618,7 @@ slots:
80 self.check_results(r, expected=expected)
81
82 def test_check_declaration_slots_deny_connection_attrib_list_match_unmatching_plug_names(
83- self
84+ self,
85 ):
86 """Test check_declaration - slots/deny-connection/attrib - list match snap attribute str in decl list (unmatching plug-names)"""
87 slots = {"iface-foo": {"interface": "foo", "attrib1": "b"}}

Subscribers

People subscribed via source and target branches