-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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 black to templates and fixed unit tests Fixes #5809 #5814
Conversation
I think we should also run black on these files in pre-commit? |
That I am not sure how to do. When you attempt to run the tool on the .templ files it throws a syntax error because of all the I suppose I could write up a script would do that whole process automatically? Or perhaps there is a much easier way that I am not aware of, which is likely? |
I think for templates it might be OK for this to be a one-time thing, given we cannot simply rely on black. It is not only the variables, the commented-out code should be left as it was, it must be distinguishable from regular comments. |
Could you revert the changes to commented-out code before we merge? |
Codecov Report
@@ Coverage Diff @@
## master #5814 +/- ##
==========================================
+ Coverage 88.93% 88.94% +0.01%
==========================================
Files 162 162
Lines 10992 11002 +10
Branches 1798 1798
==========================================
+ Hits 9776 9786 +10
Misses 937 937
Partials 279 279
|
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.
Awesome!
# "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", | ||
# "Accept-Language": "en", |
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.
Nice indentation catch!
I ran black formatter on all of the template files in
scrapy/templates
. There were very few changes that it made, most of which were changing single quotes'
to double quotes"
, or adding a single space in between the hash character and everything else for commented out values in thesettings.py
file.It did break a few unit tests for the
genspider
command used regex for string comparisons. I fixed these by making the regex patterns ambiguous to single or double quotes.Fixes #5809
This shouldn't have any effect on #5808 since I used the same quote ambiguous patterns for the regex in that PR as well.