Menu

#81 make all sardana PEP8 compliant

unassigned
waiting
None
taurus
bug
2016-01-14
2014-02-04
No

It can be done with autopep8, but tweaking it so that it does n not ugly things.

For example, I tried autopep8 with its default settings and observed that:

foo = bar - 1 # long comment that goes over col=79....

gets transformed into:

foo = bar -  \ 
          1 # long comment that goes over col=79....

and I would prefer something like:

foo = bar -  1 # here I write a very long 
               # comment that goes 
               # over col=79....

Discussion

  • Tiago Coutinho

    Tiago Coutinho - 2014-02-05

    Well,
    In fact you should avoid using inline comments:

    http://www.python.org/dev/peps/pep-0008/#id22

    It would be nice if instead autopep8 could transform all inline comments into a dedicated block comment above the code line

     

    Last edit: Tiago Coutinho 2014-02-05
    • Carlos Pascual

      Carlos Pascual - 2014-02-05

      What it says is you use them sparingly (do not use them to state obvious things).

      I think they are justified in the following situations:

      • non obvious statements (e.g. when you code something in a strange way to keep backwards compatibility with some old library...)
      • marking TO-DOs or workarounds
      • pointing to sources of recipes or to bug reports related with a certain part of the code

      Unfortunately these cases are precisely the ones that tend to be long comments.

      That said, I totally agree with Tiago that it would be nice if we find a way of converting those to comment blocks above the line

       
  • Zbigniew Reszela

    • status: pending --> waiting
     
  • Carlos Pascual

    Carlos Pascual - 2014-07-08
    • Milestone: Jul14 --> Jan15
     
  • Carlos Pascual

    Carlos Pascual - 2015-02-03
    • Milestone: Jan15 --> unassigned
     
  • Zbigniew Reszela

    • Milestone: Jan16 --> unassigned