Skip to content

Codefix: Remove unneeded "global"#369

Merged
FLHerne merged 1 commit intoOpenTTD:masterfrom
glx22:flake
Mar 31, 2025
Merged

Codefix: Remove unneeded "global"#369
FLHerne merged 1 commit intoOpenTTD:masterfrom
glx22:flake

Conversation

@glx22
Copy link
Contributor

@glx22 glx22 commented Mar 31, 2025

Flake8 7.2.0 introduced new checks and in result we get

Error: nml/actions/action1.py:191:5: F824 `global spriteset_collections` is unused: name is never assigned in scope
Error: nml/ast/grf.py:141:9: F824 `global param_stats` is unused: name is never assigned in scope

After some reading, these two global are not needed because we modify the actual object and not the reference to the object.

So make flake8 happy again and remove the useless global.

Copy link
Contributor

@FLHerne FLHerne left a comment

Choose a reason for hiding this comment

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

Can you please update the comment for spriteset_collections?
It appears to have been overlooked in b86d93

Copy link
Contributor

@FLHerne FLHerne left a comment

Choose a reason for hiding this comment

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

LGTM

@FLHerne FLHerne merged commit f2db307 into OpenTTD:master Mar 31, 2025
21 checks passed
@glx22 glx22 deleted the flake branch March 31, 2025 22:13
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.

2 participants