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

apply Flake8 and add it to CI #303

Merged
merged 14 commits into from Jan 9, 2023
Merged

apply Flake8 and add it to CI #303

merged 14 commits into from Jan 9, 2023

Conversation

hirosassa
Copy link
Collaborator

@hirosassa hirosassa commented Jan 8, 2023

SSIA

I applied flake8 to gokart.
I separated commit for each flake8 error code.

Plz review.

@@ -30,7 +31,8 @@ APScheduler = "*"
redis = "*"
matplotlib = "*"

[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

[tool.flake8]
# B006: Do not use mutable data structures for argument defaults. They are created during function definition time. All calls to the function reuse this one instance of that data structure, persisting changes between them.
# B008 Do not perform function calls in argument defaults. The call is performed only once at function definition time. All calls to your function will reuse the result of that definition-time function call. If this is intended, assign the function call to a module-level variable and use that variable as a default value.
ignore = "B006,B008"
Copy link
Collaborator Author

@hirosassa hirosassa Jan 8, 2023

Choose a reason for hiding this comment

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

[comment]
I would like to ignore these two error codes currently because it will need huge effort for refactoring. Maybe fixed in next PR.

Copy link
Member

Choose a reason for hiding this comment

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

B006 might be able to avoid potential bugs. Looking forward to consequent PRs :)

@@ -30,7 +31,8 @@ APScheduler = "*"
redis = "*"
matplotlib = "*"

[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]
pyproject-flake8 = "5.0.4"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

[discussion]

This version constraint comes from that flake8 > 6.0.0 needs python 3.8.1+. Can we go python 3.8.1+ ?
PyCQA/flake8#1741

Copy link
Member

Choose a reason for hiding this comment

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

@hirosassa We may proceed to 3.8.1+, but would prefer another PR.

@Hi-king Hi-king merged commit a9f1b7a into m3dev:master Jan 9, 2023
@Hi-king
Copy link
Member

Hi-king commented Jan 9, 2023

@hirosassa Thank you for cool refactoring!

@hirosassa hirosassa deleted the flake8 branch January 9, 2023 22:18
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

3 participants