Skip to content

Commit b36bc7a

Browse files
Fix extra blank lines and duplicate </details> in primer comment
- Remove extra blank line between header and first package section - Remove blank lines inside <details> blocks for cleaner markdown - Fix duplicate </details> when new_messages exist but missing_messages don't (checked `missing_messages` dict truthiness instead of `missing_messages["messages"]`)
1 parent 25dde54 commit b36bc7a

5 files changed

Lines changed: 10 additions & 23 deletions

File tree

pylint/testutils/_primer/primer_compare_command.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def _create_comment(self, comparator: Comparator) -> str:
4141
def _create_comment_for_package(
4242
self, package: str, new_messages: PackageData, missing_messages: PackageData
4343
) -> str:
44-
comment = f"\n\n**Effect on [{package}]({self.packages[package].url}):**\n"
44+
comment = f"\n**Effect on [{package}]({self.packages[package].url}):**\n\n"
4545
# Create comment for new messages
4646
count = 1
4747
astroid_errors = 0
@@ -73,15 +73,15 @@ def _create_comment_for_package(
7373
)
7474
if new_non_astroid_messages:
7575
comment += (
76-
"The following messages are now emitted:\n\n<details>\n\n"
76+
"The following messages are now emitted:\n\n<details>\n"
7777
+ new_non_astroid_messages
78-
+ "\n</details>\n\n"
78+
+ "</details>\n\n"
7979
)
8080

8181
# Create comment for missing messages
8282
count = 1
8383
if missing_messages["messages"]:
84-
comment += "The following messages are no longer emitted:\n\n<details>\n\n"
84+
comment += "The following messages are no longer emitted:\n\n<details>\n"
8585
print("No longer emitted:")
8686
for message in missing_messages["messages"]:
8787
comment += f"{count}) {message['symbol']}:\n*{message['message']}*\n"
@@ -99,8 +99,8 @@ def _create_comment_for_package(
9999
)
100100
count += 1
101101
print(message)
102-
if missing_messages:
103-
comment += "\n</details>\n\n"
102+
if missing_messages["messages"]:
103+
comment += "</details>\n\n"
104104
return comment
105105

106106
def _truncate_comment(self, comment: str) -> str:
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
🤖 **Effect of this PR on checked open source code:** 🤖
22

33

4-
54
**Effect on [astroid](https://github.com/pylint-dev/astroid):**
5+
66
The following messages are no longer emitted:
77

88
<details>
9-
109
1) locally-disabled:
1110
*Locally disabling redefined-builtin (W0622)*
1211
https://github.com/pylint-dev/astroid/blob/1234567890abcdef/astroid/__init__.py#L91
1312
2) unknown-option-value:
1413
*Unknown option value for 'disable', expected a valid pylint message and got 'Ellipsis'*
1514
https://github.com/pylint-dev/astroid/blob/1234567890abcdef/astroid/__init__.py#L91
16-
1715
</details>
1816

1917
*This comment was generated for commit v2.14.2*
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
🤖 **Effect of this PR on checked open source code:** 🤖
22

33

4-
54
**Effect on [astroid](https://github.com/pylint-dev/astroid):**
5+
66
The following messages are now emitted:
77

88
<details>
9-
109
1) locally-disabled:
1110
*Locally disabling redefined-builtin [we added some text in the message] (W0622)*
1211
https://github.com/pylint-dev/astroid/blob/123456789abcdef/astroid/__init__.py#L91
13-
1412
</details>
1513

1614
The following messages are no longer emitted:
1715

1816
<details>
19-
2017
1) locally-disabled:
2118
*Locally disabling redefined-builtin (W0622)*
2219
https://github.com/pylint-dev/astroid/blob/123456789abcdef/astroid/__init__.py#L91
23-
2420
</details>
2521

2622
*This comment was generated for commit v2.14.2*
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
🤖 **Effect of this PR on checked open source code:** 🤖
22

33

4-
54
**Effect on [astroid](https://github.com/pylint-dev/astroid):**
5+
66
The following messages are now emitted:
77

88
<details>
9-
109
1) locally-disabled:
1110
*Locally disabling redefined-builtin [we added some text in the message] (W0622)*
1211
https://github.com/pylint-dev/astroid/blob/123456789abcdef/astroid/__init__.py#L91
13-
14-
</details>
15-
16-
1712
</details>
1813

1914
*This comment was generated for commit v2.14.2*
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
🤖 **Effect of this PR on checked open source code:** 🤖
22

33

4-
54
**Effect on [astroid](https://github.com/pylint-dev/astroid):**
5+
66
The following messages are no longer emitted:
77

88
<details>
9-
109
1) unknown-option-value:
1110
*Unknown option value for 'disable', expected a valid pylint message and got 'Ellipsis'*
1211
https://github.com/pylint-dev/astroid/blob/123456789abcdef/astroid/__init__.py#L91
13-
1412
</details>
1513

1614
*This comment was generated for commit v2.14.2*

0 commit comments

Comments
 (0)