@@ -152,30 +152,44 @@ def get_message(log_file, repo, pr_number, sha, run_id, details):
152
152
details = details ,
153
153
)
154
154
155
- commit_link = (
156
- "\n \n _Generated for commit:"
157
- f" [{ sha [:7 ]} ](https://github.com/{ repo } /pull/{ pr_number } /commits/{ sha } )_"
155
+ sub_text = (
156
+ "\n \n <sub> _Generated for commit:"
157
+ f" [{ sha [:7 ]} ](https://github.com/{ repo } /pull/{ pr_number } /commits/{ sha } ). "
158
+ "Link to the linter CI: [here]"
159
+ f"(https://github.com/{ repo } /actions/runs/{ run_id } )_ </sub>"
158
160
)
159
161
160
162
if not message :
161
163
# no issues detected, so this script "fails"
162
164
return (
163
165
"## ✔️ Linting Passed\n "
164
166
"All linting checks passed. Your pull request is in excellent shape! ☀️"
165
- + commit_link
167
+ + sub_text
166
168
)
167
169
170
+ if not details :
171
+ # This happens if posting the log fails, which happens if the log is too
172
+ # long. Typically, this happens if the PR branch hasn't been updated
173
+ # since we've introduced import sorting.
174
+ branch_not_updated = (
175
+ "_Merging with `upstream/main` might fix / improve the issues if you "
176
+ "haven't done that since 21.06.2023._\n \n "
177
+ )
178
+ else :
179
+ branch_not_updated = ""
180
+
168
181
message = (
169
182
"## ❌ Linting issues\n \n "
170
- "This PR is introducing linting issues. Here's a summary of the issues. "
171
- "Note that you can avoid having linting issues by enabling `pre-commit` "
172
- "hooks. Instructions to enable them can be found [here]("
173
- "https://scikit-learn.org/dev/developers/contributing.html#how-to-contribute)."
174
- "\n \n "
175
- "You can see the details of the linting issues under the `lint` job [here]"
176
- f"(https://github.com/{ repo } /actions/runs/{ run_id } )\n \n "
183
+ + branch_not_updated
184
+ + "This PR is introducing linting issues. Here's a summary of the issues. "
185
+ + "Note that you can avoid having linting issues by enabling `pre-commit` "
186
+ + "hooks. Instructions to enable them can be found [here]("
187
+ + "https://scikit-learn.org/dev/developers/contributing.html#how-to-contribute)"
188
+ + ".\n \n "
189
+ + "You can see the details of the linting issues under the `lint` job [here]"
190
+ + f"(https://github.com/{ repo } /actions/runs/{ run_id } )\n \n "
177
191
+ message
178
- + commit_link
192
+ + sub_text
179
193
)
180
194
181
195
return message
0 commit comments