-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Apply black #619
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 #619
Conversation
|
I started to implement https://github.com/return42/searxng/commits/black-code-style A Here is the error message, pyyaml is installed in the virtualenv, but with a |
|
pyaml is required to run setup.py, so it has be declared as such in project.toml:
But to make it simple why not run black with parameters: black is not very configurable, but as described, it would solve the code formatting discussion. |
Personally I prefer a config file .. what can be read by other tools also. I don't know if we should reinvent our "requirements" setup to have such a toml file .. ? |
|
How about using That is how about omitting the second commit? |
|
I pushed a new version: A first commit update
A second commit contains the result of A third one fixes some pylint issues (it can be improved, but at least the tests pass). |
fine, thanks .. I will have a look. What do you think about [EDIT] now I see there is a |
| HTML_TAGS = [ | ||
| 'embed', 'iframe', 'object', 'param', 'picture', 'source', 'svg', 'math', 'canvas', 'noscript', 'script', | ||
| 'del', 'ins', 'area', 'audio', 'img', 'map', 'track', 'video', 'a', 'abbr', 'b', 'bdi', 'bdo', 'br', 'cite', | ||
| 'code', 'data', 'dfn', 'em', 'i', 'kdb', 'mark', 'q', 'rb', 'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'small', | ||
| 'span', 'strong', 'sub', 'sup', 'time', 'u', 'var', 'wbr', 'style', 'blockquote', 'dd', 'div', 'dl', 'dt', | ||
| 'figcaption', 'figure', 'hr', 'li', 'ol', 'p', 'pre', 'ul', 'button', 'datalist', 'fieldset', 'form', 'input', | ||
| 'label', 'legend', 'meter', 'optgroup', 'option', 'output', 'progress', 'select', 'textarea', 'applet', | ||
| 'frame', 'frameset' | ||
| 'embed', | ||
| 'iframe', | ||
| 'object', | ||
| 'param', | ||
| 'picture', | ||
| 'source', | ||
| 'svg', | ||
| 'math', | ||
| 'canvas', | ||
| 'noscript', | ||
| 'script', | ||
| 'del', | ||
| 'ins', | ||
| 'area', | ||
| 'audio', | ||
| 'img', | ||
| 'map', | ||
| 'track', | ||
| 'video', | ||
| 'a', | ||
| 'abbr', | ||
| 'b', | ||
| 'bdi', | ||
| 'bdo', | ||
| 'br', | ||
| 'cite', | ||
| 'code', | ||
| 'data', | ||
| 'dfn', | ||
| 'em', | ||
| 'i', | ||
| 'kdb', | ||
| 'mark', | ||
| 'q', | ||
| 'rb', | ||
| 'rp', | ||
| 'rt', | ||
| 'rtc', | ||
| 'ruby', | ||
| 's', | ||
| 'samp', | ||
| 'small', | ||
| 'span', | ||
| 'strong', | ||
| 'sub', | ||
| 'sup', | ||
| 'time', | ||
| 'u', | ||
| 'var', | ||
| 'wbr', | ||
| 'style', | ||
| 'blockquote', | ||
| 'dd', | ||
| 'div', | ||
| 'dl', | ||
| 'dt', | ||
| 'figcaption', | ||
| 'figure', | ||
| 'hr', | ||
| 'li', | ||
| 'ol', | ||
| 'p', | ||
| 'pre', | ||
| 'ul', | ||
| 'button', | ||
| 'datalist', | ||
| 'fieldset', | ||
| 'form', | ||
| 'input', | ||
| 'label', | ||
| 'legend', | ||
| 'meter', | ||
| 'optgroup', | ||
| 'option', | ||
| 'output', | ||
| 'progress', | ||
| 'select', | ||
| 'textarea', | ||
| 'applet', | ||
| 'frame', | ||
| 'frameset', | ||
| ] |
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.
Over all I think black formatting is good, but there are some exceptions like this one here.
In such cases we should use # fmt: off & # fmt: on.
|
FYI: I am in review with this PR, I will push some suggestions, please do not change the code while I am in review / thanks! |
return42
left a comment
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.
LGTM / thanks!
@dalf See my comment and the patches I pushed on top of your branch.
|
We should prioritize (merge) this PR over: @dalf if you want I can rebase this branch, but first have a look at the commits I pushed on top of your branch. |
OK, I will going to rebase this branch right now, please do not merge other PR with python code in the meantime .. |
"make test.black" checks for the code style "make format.python" format the python code
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Disable the python code formatting from python-black, where the readability of code suffers by formatting. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This patch was generated by black [1]::
make format.python
[1] https://github.com/psf/black
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Fix pylint issues from commit (3d96a98) [format.python] initial formatting of the python code Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
1480058 to
d84226b
Compare
|
@dalf I rebased and reorder the branch / If you think PR is ready to merge, please merge. FYI: the CI hangs for some reason I don't know, I restarted the jobs .. lets see if the tests pass now ... |
|
Seems |
|
Thank you for the update. |
What does this PR do?
This PR is demo of black:
black -l 120 -S searx searxng_extra: reformat except the simple quote.black -l 120 searx searxng_extra: reformat including the simple quote.Why is this change important?
Normalize code format.
How to test this PR locally?
Author's checklist
make testfails for now.Related issues