-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Add black job #42
Add black job #42
Conversation
Hey @giovana-morais, just a heads up: I'm super busy lately but in a few days I'll be able to review your PR. Please bear with me. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@giovana-morais thanks for your PR! I ran the flake8
command using the code from your branch and my ouput was:
(model_bakery) [bernardo@capibaribe ~/envs/model_bakery(add_black_job)]$ flake8
./tests/test_recipes.py:4:1: F401 'random.choice' imported but unused
from random import choice
^
1 F401 'random.choice' imported but unused
I saw you've com@giovana-morais thanks for your PR! I ran the flake8
command using the code from your branch and my ouput was:
(model_bakery) [bernardo@capibaribe ~/envs/model_bakery(add_black_job)]$ flake8
./tests/test_recipes.py:4:1: F401 'random.choice' imported but unused
from random import choice
^
1 F401 'random.choice' imported but unused
And you're right about the tests starting to break if we remove this import. The issue is with 2 tests that were poorly when it comes to using Python's mock
module. I don't think it's worthwhile for us to fix these tests for now. Instead you can turn of Flake8 for this specific import line by changing it to:
from random import choice
To
from random import choice # noqa
After doing that, I was able to run Flake8 lint with success =]
hey @berinhard ! thanks for the tip about |
I think now eveything is okay. Both |
Thanks @giovana-morais! Merging it right away! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done, @giovana-morais! 🎉
Don't make baker sad." % str(item)) | ||
raise ValueError( | ||
"Required value '%s' is of wrong type. \ | ||
Don't make baker sad." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we couldn't have made it one line. 🤔
References issue #38
Changes:
dev_requirements.txt
,.pre-commit-config.yaml
,.travis.yml
andtox.ini
Now I need help with two
import
statements thatflake8
claims are unused. One of them is in the filetest_recipes.py
(from random import choices
) and the other one is in the filetest_filling_fields.py
(from django.core.files import images, File
).I tried commenting both imports and building it on Travis and the build failed for the
random
import, so I just keptdjango
import commented, and usedSKIP=flake8,pydocstyle
before my commit. After that the build worked just fine, but if I try to run flake8, it will fail with thetest_filling_fields.py
. Any ideas?