You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating system: Ubuntu Xenial
Python version: Python 3.6.7 Black version: 19.3b0
Does also happen on master: Yes.
Hi there, I come from @OCA, where we have a ton of repos that now started using Black, so I think this one won't be my last issue here. 😄
Well, we develop Odoo and many of our source codes are Odoo manifests, which look like this until now:
# Copyright 2016 Nicolas Bessi, Camptocamp SA# Copyright 2018-2019 Tecnativa - Pedro M. Baeza# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Location management (aka Better ZIP)",
"version": "13.0.1.0.0",
"depends": ["base_address_city", "contacts"],
"author": "Camptocamp,""ACYSOS S.L.,""Alejandro Santana,""Tecnativa,""AdaptiveCity,""Odoo Community Association (OCA)",
"license": "AGPL-3",
"summary": """Enhanced zip/npa management system""",
"website": "https://github.com/OCA/partner-contact",
"data": [
"security/ir.model.access.csv",
"views/res_city_zip_view.xml",
"views/res_city_view.xml",
"views/res_country_view.xml",
"views/res_company_view.xml",
"views/res_partner_view.xml",
],
"demo": ["demo/res_city_zip.xml"],
"installable": True,
"auto_install": False,
}
The problem is in the author key, that after blacked it looks like this (stripped the rest):
...
"depends": ["base_address_city", "contacts"],
"author": "Camptocamp,""ACYSOS S.L.,""Alejandro Santana,""Tecnativa,""AdaptiveCity,""Odoo Community Association (OCA)",
"license": "AGPL-3",
...
Not very readable! In fact, it was better before.
@sbidoul found that wrapping that with a parenthesis made Black behave fine, as you can see in OCA/partner-contact#793 (it's a very short PR, check it please).
So, is this the intended behavior? It doesn't seem like a very beautiful default...
Regards.
The text was updated successfully, but these errors were encountered:
I think #620 will help this issue. Having said that, when (in the future) Black will start automatically merging strings, it will merge all these authors into one string which is probably not your intention. Looks like the hack to inline multiple authors into the single author field of the Odoo manifest will break down at that point. You could always do ",".join(["author1", "author2"]) I guess, which expresses your intent better, and will help Black format this file properly as well.
Closing this issue as I believe the string alignment issue is covered by #620.
Operating system: Ubuntu Xenial
Python version: Python 3.6.7
Black version: 19.3b0
Does also happen on master: Yes.
Hi there, I come from @OCA, where we have a ton of repos that now started using Black, so I think this one won't be my last issue here. 😄
Well, we develop Odoo and many of our source codes are Odoo manifests, which look like this until now:
The problem is in the
author
key, that after blacked it looks like this (stripped the rest):Not very readable! In fact, it was better before.
@sbidoul found that wrapping that with a parenthesis made Black behave fine, as you can see in OCA/partner-contact#793 (it's a very short PR, check it please).
So, is this the intended behavior? It doesn't seem like a very beautiful default...
Regards.
The text was updated successfully, but these errors were encountered: