Skip to content

"--check" reports a change which black wouldn't makeΒ #3123

@mbenecke

Description

@mbenecke

I discoverd an different beheavior between "change" and "check":

If I run "black" to my project, it reports no changes.

$ black --diff *.py
All done! ✨ 🍰 ✨
12 files would be left unchanged.

But "--check" reports an issue

$ black --check --preview --diff *.py
--- get_curve.py	2022-06-17 07:38:10.719823 +0000
+++ get_curve.py	2022-06-17 07:39:26.411995 +0000
@@ -31,11 +31,12 @@
         sens_data, sens_ext_datal, sens_owm_data, t1, t2, t3 = extract_pg_data(
             con, device_id, device_id_ext, device_id_owm
         )
         if t1 == -1 or t2 == -1 or t3 == -1:
             logger.info(
-                "No enough ...... data .. ...... ....... ..... .......... is stored yet!"
+                "No enough ...... data .. ...... ....... ..... .......... is stored"
+                " yet!"
             )
             # todo: .....

would reformat get_curve.py

Oh no! πŸ’₯ πŸ’” πŸ’₯
1 file would be reformatted, 11 files would be left unchanged.

If I do this change, black --diff *.py ignores it and it stays in the form --check likes to see

$ black --version
black, 22.3.0 (compiled: yes)

Metadata

Metadata

Assignees

No one assigned

    Labels

    T: bugSomething isn't working
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions