Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@FrancoisPgm
Copy link
Contributor

Reference Issues/PRs

Following the discussion on #32751

What does this implement/fix? Explain your changes.

The linter bot no longer adds a comment when the linting succeeds, it only comments when the linting fails and removes its comment when the linting is fixed.

The code in build_tools/get_comment.py is also refactored to use the pyGithub package instead of http requests.

Any other comments?

Tested on my fork in FrancoisPgm#5, although it might be tough to see it's working as the comments are now removed.

@github-actions
Copy link

github-actions bot commented Nov 27, 2025

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 42fe67c. Link to the linter CI: here

@lesteve
Copy link
Member

lesteve commented Nov 28, 2025

Thanks a lot for the PR! Looks good at a glance, I'll try to take a closer look next week.

Out of curiosity, what is your first-hand feeling about moving to PyGithub, does it simplify the code a bit, or not that much?

@FrancoisPgm
Copy link
Contributor Author

FrancoisPgm commented Dec 1, 2025

Yes it does simplify quite a bit, notably you only have to use your token once to authenticate when creating the Github object. Also you can get an issue object that you can pass around to do multiple operations on it, instead of having to pass all repo, token and pr_nupmber info to all functions. And you don't have to manually check if the request failed or not. So I find the change totally worth it.
Oh and it's much better for code readability too.

Copy link
Member

@lesteve lesteve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice, thanks!

@lesteve
Copy link
Member

lesteve commented Dec 4, 2025

Let's merge this since I mentioned it at the last meeting and no-one had strong objections. Let's see if people notice and complain!

One small side-effect I thought of: I think you will get a notification on each linting failure with this PR. Before you would get a notification once on the first linting failure and never again. I would go as far as saying this is a feature but let's see if others disagree 😉.

@lesteve lesteve changed the title CI Remove the "Linting passed" comment from the bot and use pygithub in get_comment.py CI Make linting bot comment only on failure Dec 4, 2025
@lesteve lesteve merged commit 41ceebb into scikit-learn:main Dec 4, 2025
38 checks passed
lesteve added a commit to lesteve/scikit-learn that referenced this pull request Dec 9, 2025
@lesteve lesteve mentioned this pull request Dec 9, 2025
14 tasks
lesteve added a commit to lesteve/scikit-learn that referenced this pull request Dec 9, 2025
lesteve added a commit that referenced this pull request Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants