From 9a511f1a33daa30e4edb659cdcf04fa23adaa14b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Aug 2014 14:40:35 +0200 Subject: [PATCH] Remove long line wrapping from Python parameter list generation code. This doesn't play well with PEP8 checks which imposes very strict continuation line indentation rules which need to be _visually_ aligned, i.e. the subsequent lines must be indented by the position of the opening bracket in the function declaration line, but the code generating the parameter lists doesn't have this information and so it's impossible to do it while avoiding either E128 or E123 ("continuation line {under,over}-indented for visual indent" respectively) error from pep8. Moreover, the wrapping code didn't work correctly anyhow as it only took into account the length of the parameter list itself and not the total line length, which should include the function name as well. So just disable wrapping entirely, long lines shouldn't be a problem anyhow in auto-generated code. --- Source/Modules/python.cxx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index 39703bc7e..825072269 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -1637,9 +1637,7 @@ public: Parm *pnext; - int lines = 0; int start_arg_num = is_wrapping_class() ? 1 : 0; - const int maxwidth = 80; if (calling) func_annotation = false; @@ -1689,12 +1687,6 @@ public: if (Len(doc)) { // add a comma to the previous one if any Append(doc, ", "); - - // Do we need to wrap a long line? - if ((Len(doc) - lines * maxwidth) > maxwidth) { - Printf(doc, "\n%s", tab4); - lines += 1; - } } // Do the param type too?