Describe the bug
Non-idempotent source
To Reproduce
assert sort_by_dependency(
{
"1": {"2", "3"}, "2": {"2a", "2b"}, "3": {"3a", "3b"},
"2a": set(), "2b": set(), "3a": set(), "3b": set()
}
) == ["2a", "2b", "2", "3a", "3b", "3", "1"]
Run
black mytest.py
touch mytest.py
black --check mytest.py
Expected behavior
Second call to black shouldn't find changes to the code, but it does
** Actual behavior **
First call formats to
assert sort_by_dependency(
{
"1": {"2", "3"},
"2": {"2a", "2b"},
"3": {"3a", "3b"},
"2a": set(),
"2b": set(),
"3a": set(),
"3b": set(),
}
) == ["2a", "2b", "2", "3a", "3b", "3", "1"]
Second call formats to
assert (
sort_by_dependency(
{
"1": {"2", "3"},
"2": {"2a", "2b"},
"3": {"3a", "3b"},
"2a": set(),
"2b": set(),
"3a": set(),
"3b": set(),
}
)
== ["2a", "2b", "2", "3a", "3b", "3", "1"]
)
Environment (please complete the following information):
- Version: black, version 21.9b0
- OS and Python version: mac - Python 3.9.7
Does this bug also happen on main?
Yep - just confirmed
Additional context
may be possible to minimize the test case, but haven't tried too much
Describe the bug
Non-idempotent source
To Reproduce
Run
Expected behavior
Second call to black shouldn't find changes to the code, but it does
** Actual behavior **
First call formats to
Second call formats to
Environment (please complete the following information):
Does this bug also happen on main?
Yep - just confirmed
Additional context
may be possible to minimize the test case, but haven't tried too much