zbyszek / fedora-rust / rust2rpm

Forked from fedora-rust/rust2rpm 5 years ago
Clone

3feaa7f Revert "Enforce consistent formatting with black"

Authored and Committed by zbyszek 2 years ago
    Revert "Enforce consistent formatting with black"
    
    This reverts commit a16df5f90f8966f50ffc23e654e023320b57f6aa.
    
    Black has some unfixable issues:
    
    - it doesn't understand context. For example, in a sequence of repeated
      statements with identical structure, we very much want to apply
      consistent formatting. Sadly, black will squish or split-apart the
      lines that are too short or too long.
    
      This is the primary problem and I don't think it's likely to be fixed,
      unless the formatter gets smarter.
    
      For an example, see the (reverted) changes to argparse construction.
    
    - black uses unpythonic style with double quotes, making the text
      heavier. This is a matter of style, but there is no reason to switch
      to the other style.
    
      For a ugly sample, see the (reverted) changes to test_cfg.py.
    
    - black doesn't understand local logic, for example when some words
      are indented to show structure or grouped together for some other
      reasons.
    
      For examples, see the (reverted) changes to regexp construction.
    
    - black sometimes goes crazy with splitting lines, changing some
      fairly readable line that is just over the length limit into
      5+ lines, some with just a few characters.
    
    - black changes over time, so we'd get a constant stream of "improvements",
      resulting in noise in the diffs.
    
    I have no problem with people using black as a helper: to do formatting
    on code that is being written or rewritten, or to apply black and
    cherry-pick the reasonable changes. But removing carefully hand-made
    formatting in the name of "consistency" is terrible.
    
    
    # Conflicts:
    #	rust2rpm/__init__.py
    #	rust2rpm/__main__.py
    #	rust2rpm/cfg.py
    #	rust2rpm/tests/test_cfg.py
    
        
file modified
+1 -1
file modified
+133 -236
file modified
+35 -41
file modified
+10 -7
file modified
+127 -115
file modified
+63 -69
file modified
+19 -28
file modified
+1 -1
file modified
+16 -19
file modified
+208 -187
file modified
+15 -19