Skip to content

Commit af90238

Browse files
Pierre-Sassoulasranadheerg
authored andcommitted
[test] Add primer test cases for suboptimal diff scenarios (pylint-dev#10946)
Document current behavior where line-only moves, message text changes, type changes, and useless-suppression pairs all show as full remove+add in the primer comment. These cases will help validate future smarter diff logic.
1 parent 12ee903 commit af90238

20 files changed

Lines changed: 419 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
🤖 **Effect of this PR on checked open source code:** 🤖
2+
3+
4+
**Effect on [astroid](https://github.com/pylint-dev/astroid):**
5+
6+
The following messages are now emitted:
7+
8+
<details>
9+
1) too-complex:
10+
*'my_function' is too complex. The McCabe rating is 18*
11+
https://github.com/pylint-dev/astroid/blob/123456789abcdef/astroid/node_classes.py#L103
12+
</details>
13+
14+
The following messages are no longer emitted:
15+
16+
<details>
17+
1) too-complex:
18+
*'my_function' is too complex. The McCabe rating is 18*
19+
https://github.com/pylint-dev/astroid/blob/123456789abcdef/astroid/node_classes.py#L100
20+
</details>
21+
22+
*This comment was generated for commit v2.14.2*
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{ "package": "astroid", "missing": 1, "new": 1 }]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"astroid": {
3+
"commit": "1234567890abcdef",
4+
"messages": [
5+
{
6+
"type": "convention",
7+
"module": "astroid.node_classes",
8+
"obj": "my_function",
9+
"line": 100,
10+
"column": 0,
11+
"endLine": 100,
12+
"endColumn": 15,
13+
"path": "tests/.pylint_primer_tests/pylint-dev/astroid/astroid/node_classes.py",
14+
"symbol": "too-complex",
15+
"message": "'my_function' is too complex. The McCabe rating is 18",
16+
"message-id": "R1260"
17+
}
18+
]
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"astroid": {
3+
"commit": "123456789abcdef",
4+
"messages": [
5+
{
6+
"type": "convention",
7+
"module": "astroid.node_classes",
8+
"obj": "my_function",
9+
"line": 103,
10+
"column": 0,
11+
"endLine": 103,
12+
"endColumn": 15,
13+
"path": "tests/.pylint_primer_tests/pylint-dev/astroid/astroid/node_classes.py",
14+
"symbol": "too-complex",
15+
"message": "'my_function' is too complex. The McCabe rating is 18",
16+
"message-id": "R1260"
17+
}
18+
]
19+
}
20+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
🤖 **Effect of this PR on checked open source code:** 🤖
2+
3+
4+
**Effect on [astroid](https://github.com/pylint-dev/astroid):**
5+
6+
The following messages are now emitted:
7+
8+
<details>
9+
1) too-complex:
10+
*'my_function' is too complex. The McCabe rating is 17*
11+
https://github.com/pylint-dev/astroid/blob/123456789abcdef/astroid/node_classes.py#L103
12+
</details>
13+
14+
The following messages are no longer emitted:
15+
16+
<details>
17+
1) too-complex:
18+
*'my_function' is too complex. The McCabe rating is 18*
19+
https://github.com/pylint-dev/astroid/blob/123456789abcdef/astroid/node_classes.py#L100
20+
</details>
21+
22+
*This comment was generated for commit v2.14.2*
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{ "package": "astroid", "missing": 1, "new": 1 }]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"astroid": {
3+
"commit": "1234567890abcdef",
4+
"messages": [
5+
{
6+
"type": "convention",
7+
"module": "astroid.node_classes",
8+
"obj": "my_function",
9+
"line": 100,
10+
"column": 0,
11+
"endLine": 100,
12+
"endColumn": 15,
13+
"path": "tests/.pylint_primer_tests/pylint-dev/astroid/astroid/node_classes.py",
14+
"symbol": "too-complex",
15+
"message": "'my_function' is too complex. The McCabe rating is 18",
16+
"message-id": "R1260"
17+
},
18+
{
19+
"type": "warning",
20+
"module": "astroid",
21+
"obj": "",
22+
"line": 91,
23+
"column": 0,
24+
"endLine": null,
25+
"endColumn": null,
26+
"path": "tests/.pylint_primer_tests/pylint-dev/astroid/astroid/__init__.py",
27+
"symbol": "unknown-option-value",
28+
"message": "Unknown option value for 'disable', expected a valid pylint message and got 'Ellipsis'",
29+
"message-id": "W0012"
30+
}
31+
]
32+
}
33+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"astroid": {
3+
"commit": "123456789abcdef",
4+
"messages": [
5+
{
6+
"type": "convention",
7+
"module": "astroid.node_classes",
8+
"obj": "my_function",
9+
"line": 103,
10+
"column": 0,
11+
"endLine": 103,
12+
"endColumn": 15,
13+
"path": "tests/.pylint_primer_tests/pylint-dev/astroid/astroid/node_classes.py",
14+
"symbol": "too-complex",
15+
"message": "'my_function' is too complex. The McCabe rating is 17",
16+
"message-id": "R1260"
17+
},
18+
{
19+
"type": "warning",
20+
"module": "astroid",
21+
"obj": "",
22+
"line": 91,
23+
"column": 0,
24+
"endLine": null,
25+
"endColumn": null,
26+
"path": "tests/.pylint_primer_tests/pylint-dev/astroid/astroid/__init__.py",
27+
"symbol": "unknown-option-value",
28+
"message": "Unknown option value for 'disable', expected a valid pylint message and got 'Ellipsis'",
29+
"message-id": "W0012"
30+
}
31+
]
32+
}
33+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
🤖 **Effect of this PR on checked open source code:** 🤖
2+
3+
4+
**Effect on [astroid](https://github.com/pylint-dev/astroid):**
5+
6+
The following messages are now emitted:
7+
8+
<details>
9+
1) locally-disabled:
10+
*Locally disabling redefined-builtin [we added some text in the message] (W0622)*
11+
https://github.com/pylint-dev/astroid/blob/123456789abcdef/astroid/__init__.py#L91
12+
2) too-complex:
13+
*'my_function' is too complex. The McCabe rating is 17*
14+
https://github.com/pylint-dev/astroid/blob/123456789abcdef/astroid/node_classes.py#L105
15+
</details>
16+
17+
The following messages are no longer emitted:
18+
19+
<details>
20+
1) locally-disabled:
21+
*Locally disabling redefined-builtin (W0622)*
22+
https://github.com/pylint-dev/astroid/blob/123456789abcdef/astroid/__init__.py#L91
23+
2) too-complex:
24+
*'my_function' is too complex. The McCabe rating is 18*
25+
https://github.com/pylint-dev/astroid/blob/123456789abcdef/astroid/node_classes.py#L100
26+
</details>
27+
28+
*This comment was generated for commit v2.14.2*
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{ "package": "astroid", "missing": 2, "new": 2 }]

0 commit comments

Comments
 (0)