Assert statement condition broken up in unfortunate way
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 41.8k
- Forks
- 2.9k
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 9
Description
Operating system: Win 10 1803 x64
Python version: 3.6.5
Black version: 18.6b2
Does also happen on master: yes
Black outputs the following code in one project (https://github.com/googlei18n/fontmake/pull/444/commits/e22a624deb3429eb4882e9c31cb15e8c769fc1f9):
assert len(ufo_order) == len(
ot_order
), "{}, subsetting: amount of glyphs does not match with {}".format(
ufo.path, otf_path
)
The placement of the assert condition is unfortunate... Is this expected? Is there a more elegant way to write that code?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running Black on the assert example from the issue and compare the output with the original formatting. Then trace the formatter behavior responsible for splitting the assert condition and determine whether the project has tests covering this case. The issue is done only when the intended, more elegant formatting is agreed and captured by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100