Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flake8 fixes #8

Merged
merged 2 commits into from
Jun 3, 2019
Merged

flake8 fixes #8

merged 2 commits into from
Jun 3, 2019

Conversation

Aniket21mathur
Copy link
Contributor

No description provided.

@quozl
Copy link
Contributor

quozl commented May 31, 2019

Thanks. Good progress. Is work in progress? As of 9448228, there are 36 remaining flake8 messages, down from 155. 😁

@Aniket21mathur
Copy link
Contributor Author

I fixed the other warnings, although there are still 5 to 6 flake8 warnings, but I think making changes as per these will affect the functionality. Thanks!

@quozl
Copy link
Contributor

quozl commented Jun 2, 2019

Thanks. I've run flake8 and reviewed each warning;

./NutritionActivity.py:120:9: F841 local variable 'group_game_button' is assigned to but never used
./NutritionActivity.py:127:9: F841 local variable 'calorie_game_button' is assigned to but never used
./NutritionActivity.py:134:9: F841 local variable 'pyramid_game_button' is assigned to but never used
./NutritionActivity.py:141:9: F841 local variable 'balance_game_button' is assigned to but never used
./NutritionActivity.py:182:9: F841 local variable 'image_button' is assigned to but never used
./NutritionActivity.py:189:9: F841 local variable 'create_button' is assigned to but never used

These are all local variables created by assignment and never used. Can you explain why the assignment cannot be removed?

./NutritionActivity.py:222:21: W503 line break before binary operator

This can be changed without affecting function.

./game.py:126:80: E501 line too long (83 > 79 characters)
./game.py:136:80: E501 line too long (81 > 79 characters)

These too.

./sprites.py:261:27: E741 ambiguous variable name 'l'

This variable name can be changed.

@Aniket21mathur
Copy link
Contributor Author

These are all local variables created by assignment and never used. Can you explain why the assignment cannot be removed?

These variable refer to button icons on the toolbar, removing these will remove those icons from the UI. Clicking on those icons results in different game modes.

This can be changed without affecting function.

Fixing it results in W504 line break after binary operator and alternatively fixing one result in another.

These too.

Thanks, fixed.

This variable name can be changed

Thanks, fixed.

@quozl
Copy link
Contributor

quozl commented Jun 2, 2019

Thanks. Why does removing the assignment to a function-local variable remove the icons from the UI? Have you tested that?

@Aniket21mathur
Copy link
Contributor Author

Aniket21mathur commented Jun 3, 2019

Why does removing the assignment to a function-local variable remove the icons from the UI?

Thanks,Fixed. Actually I misunderstood things, the variables declared simply call functions radio_factory or button_factory which adds the button to the toolbar and set its functionality, no need to define a variable for that.

The stop acclerator by default comes with the stop button, no need
to explicitly declare it.
@quozl
Copy link
Contributor

quozl commented Jun 3, 2019

Thanks!

@quozl quozl merged commit c7f0471 into sugarlabs:master Jun 3, 2019
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.

None yet

2 participants