Skip to content

Enable PLW and PLE rules#40265

Draft
cyyever wants to merge 1 commit into
huggingface:mainfrom
cyyever:fix_pl_warnings_for_model
Draft

Enable PLW and PLE rules#40265
cyyever wants to merge 1 commit into
huggingface:mainfrom
cyyever:fix_pl_warnings_for_model

Conversation

@cyyever

@cyyever cyyever commented Aug 19, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

Enable ruff PLW and PLE rules, which implement warnings and errors of Pylint.

@cyyever
cyyever marked this pull request as draft August 19, 2025 06:16
@cyyever
cyyever marked this pull request as ready for review August 19, 2025 07:43
@cyyever cyyever changed the title Fix pylint warnings Fix pylint warnings in models Aug 19, 2025
@cyyever
cyyever force-pushed the fix_pl_warnings_for_model branch 3 times, most recently from 673bf3d to ff3fc97 Compare August 19, 2025 08:23
@cyyever
cyyever marked this pull request as draft August 19, 2025 08:32
@cyyever
cyyever force-pushed the fix_pl_warnings_for_model branch 2 times, most recently from 67723cc to 85c0850 Compare August 19, 2025 08:45
@cyyever cyyever changed the title Fix pylint warnings in models Enable PLW and PLE rules Aug 19, 2025
@cyyever
cyyever marked this pull request as ready for review August 19, 2025 08:57
@cyyever
cyyever force-pushed the fix_pl_warnings_for_model branch from 85c0850 to 1404625 Compare August 19, 2025 09:05
@Rocketknight1

Copy link
Copy Markdown
Member

Since this adds new Ruff rules, cc @ArthurZucker @Cyrilvallez as core maintainers!

@ArthurZucker ArthurZucker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm !

Comment thread src/transformers/modeling_utils.py
@cyyever
cyyever force-pushed the fix_pl_warnings_for_model branch from 42b629b to f51cd77 Compare August 20, 2025 18:44
@cyyever

cyyever commented Aug 26, 2025

Copy link
Copy Markdown
Contributor Author

@ArthurZucker It is green

@cyyever
cyyever force-pushed the fix_pl_warnings_for_model branch from a26c17e to 70123dd Compare September 5, 2025 16:27

@Cyrilvallez Cyrilvallez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These rules seem a bit cumbersome/weird, please explain more as we don't want to have to add noqa comments everywhere for no reason

Comment thread src/transformers/configuration_utils.py Outdated


class PretrainedConfig(PushToHubMixin):
class PretrainedConfig(PushToHubMixin): # noqa: PLW1641

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why do we need this?

Comment thread src/transformers/commands/add_new_model_like.py Outdated
Comment thread src/transformers/modelcard.py Outdated
Comment thread src/transformers/models/pop2piano/feature_extraction_pop2piano.py Outdated
Comment thread tests/pipelines/test_pipelines_common.py Outdated
@cyyever
cyyever force-pushed the fix_pl_warnings_for_model branch 2 times, most recently from 8c5c25f to 1d582ef Compare September 24, 2025 02:19
@cyyever
cyyever marked this pull request as draft September 24, 2025 04:14
@cyyever
cyyever force-pushed the fix_pl_warnings_for_model branch 2 times, most recently from 9930c43 to 02844f5 Compare September 24, 2025 11:49
@cyyever
cyyever force-pushed the fix_pl_warnings_for_model branch 3 times, most recently from 77c0088 to e936815 Compare October 5, 2025 03:59
@cyyever
cyyever force-pushed the fix_pl_warnings_for_model branch from e936815 to 3827d72 Compare October 19, 2025 02:37
@github-actions

Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: depth_pro, marian

@cyyever
cyyever force-pushed the fix_pl_warnings_for_model branch from 3827d72 to 35399ae Compare October 19, 2025 02:40
Signed-off-by: Yuanyuan Chen <cyyever@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants