Re: [Python-Dev] Code formatter bot

2016年1月20日 00:38:02 -0800

francismb <[email protected]> writes:
> what's your opinion about a code-formatter bot for cpython.
What is the proposal? The opinions will surely depend on:
* What formatting is to be applied automatically?
 * If you propose to enforce rigid interpretations of the style-guide
 PEPs as automatic rules, that will incur the wrath of those who have
 made clear those PEPs are not to be used that way. There is a clear
 opinion (from at least the BDFL) that the style guide PEPs are
 guidelines to be applied with human judgement.
 * If on the other hand you propose to enforce only those rules which
 are strict enough to be applied automatically (e.g. "don't mix
 spaces and TABs", "encode source using UTF-8 only") then that's best
 done by editor plug-ins like EditorConfig[0].
* At which point in the workflow will the formatting be applied?
 * If you propose to change the code *after* the programmer sees it in
 their text editor, that is sure to be unpopular. The code committed
 to VCS should exactly match what the programmer sees when they
 choose to commit.
 * If you propose to reject the code at time of committing, there are
 VCS hooks that can do that; I don't know what different system you
 propose.
 * If you propose to present formatting violations as errors in the
 programmer's text editor so they can be corrected before using the
 VCS, then there are tools like EditorConfig[0] to do that.
[0]: EditorConfig <URL:http://editorconfig.org/>
-- 
 \ "Pinky, are you pondering what I'm pondering?" "I think so, |
 `\ Brain, but isn't a cucumber that small called a gherkin?" |
_o__) —_Pinky and The Brain_ |
Ben Finney
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to