I'd say if a URL is too long for 100 characters that the number could be increased in that case. I might write a short script which does do those scans automatically so that I don't have to rely on the output of tox. I could then also check if for example 'http' appears in that line, so that we know how long URLs are.
And yes 80 characters is maybe a bit to harsh, that is why I suggested 80 to 100 characters (but I'd say 100 is reasonable). And currently it's 256 which is to high I'd say because you most certainly have line wraps and those can be very confusing.
2014-12-31 13:35 GMT+01:00 info@gno.de:
python code can be limited to 80 on most cases but there might be some documentation parts like urls which exceed this limit.
Regards
xqt
----- Original Nachricht ---- Von: Ricordisamoa ricordisamoa@openmailbox.org An: Pywikipedia discussion list pywikipedia-l@lists.wikimedia.org Datum: 31.12.2014 12:13 Betreff: Re: [Pywikipedia-l] Line length
I generally dislike hard limits, but keeping lines shorter often helps. Shorter than 100 characters seems fine to me.
Il 31/12/2014 01:31, Fabian Neundorf ha scritto:
Hi all,
after a short discussion about the line length in the pywikibot-core repo I made a little analysis (or more like 'gathered' the data).
Currently the maximum allowed line length is 256 characters. Flake8 counts multi-bytes characters as one character (and afaik doesn't count the newline). The question is how easy it is to lower that to a value between 80 and 100 (when I submit code I try to have at most 80 characters sometimes it's 81).
Maybe to 200 is short term feasible with only a 16 exceeding those. With a maximum of 150 characters at least 47 lines need to be edited.
I used 'tox -e flake8' with the maximum line length set to 80 and then only used E501 entries. Some lines were garbled on the output like ?./pywikibot/1: E501 line too long (82 > 80 characters)?. I tried to repair those lines if there was at least some kind of file name and line number (e.g. ?ase.py:365?) but I deleted the rest. So those statistics only show the lowest number but I don't expect to much missing data.
The data is gathered from ad6920135ef015855724ac660fa0dcfb1459cfda. And is available sorted line number first (so they could be fixed in reversed order) or sorted with line length first (so super long lines can be fixed primarily). There is a gist which contains both lists and a list of the quantity of all line lengths [1] and a Google Spreadsheet containing just the quantity numbers [2] to determine easily how many would need to be solved when enforcing a specific limit.
Fabian
[2]:
https://docs.google.com/spreadsheets/d/1lbCDURzpTm1uViUJ3Awa2C4J-TGzi1DfJWzo IiUuKeY/edit?usp=sharing
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l