Patches for Python scripts
jkulesza at gmail.com
Sat Jan 30 01:39:01 UTC 2021
On Fri, Jan 29, 2021 at 3:40 PM Thibaut Cuvelier <tcuvelier at lyx.org> wrote:
> - The cosmetic changes are based on PEP8, which is the only style guide
> for Python. Highly similar patches already went into the code base less
> than a year ago (
> http://lists.lyx.org/pipermail/lyx-devel/2020-May/001464.html). Other
> style guides for Python are just more precise than PEP8 (e.g., Google:
> https://stackoverflow.com/a/2815311/1066843). I have yet to see an
> important open-source project that does not use PEP8 style guide. It's as
> unopiniated as opinion could get on Python.
> For now, the Python scripts follow the WTF style guide: every committer
> does what they prefer, without any kind of consistency. Python is very
> different from other languages in that there is a real consensus in the
> community on one style guide (PHP is going in the same direction, but it's
> not yet as commonly used: https://www.php-fig.org/psr/psr-2/). I am not
> proposing one style guide for C++ or Perl code, for instance.
Some food for thought based on recent experience...
The idea of code style (and style application automation) is something that
has been on my mind a lot lately. Applying the black utility [
https://github.com/psf/black] for Python and clang-format utility [
https://clang.llvm.org/docs/ClangFormat.html] for C/C++ to several projects
I work on have helped reduce style discussion, ensure uniformity, and
provide cognitive ease as code is considered. It's to the point that
several projects have early CI static analysis that ensures conformance to
the applicable style. While one may not love any particular style, having
a standard does help with pattern recognition while reading code.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the lyx-devel