Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Hard-coded line length in docstring #86

Closed
dpursehouse opened this Issue Jun 18, 2012 · 3 comments

Comments

Projects
None yet
2 participants
Contributor

dpursehouse commented Jun 18, 2012

This is a very minor one :)

If I set the maximum line length in the options, the error message still says '79 characters'

macintosh:pep8 david$ ./pep8.py test.py --show-pep8 --max-line-length 80
test.py:1:81: E501 line too long (82 characters)
 Limit all lines to a maximum of 79 characters

 There are still many devices around that are limited to 80 character
 lines; plus, limiting windows to 80 characters makes it possible to have
 several windows side-by-side.  The default wrapping on such devices looks
 ugly.  Therefore, please limit all lines to a maximum of 79 characters.
 For flowing long blocks of text (docstrings or comments), limiting the
 length to 72 characters is recommended.

 Reports error E501.
macintosh:pep8 david$ 

I don't have a fix for this because I'm not sure how to inject the value of max_line_length into the docstring.

Contributor

florentx commented Jun 18, 2012

The --show-pep8 flag show the text of PEP 8. And the PEP recommandation is not flexible about the number of characters per line. It's not a bug.

However, we might change the text of the error itself to display the runtime limit.

E501 line too long (102 > 90 characters)

Florent

Contributor

dpursehouse commented Jun 19, 2012

That would be better, but IMO it still looks a bit odd that the message contradicts the PEP 8 text.

Maybe add some other text in the error message when max_line_length is different to the default?

Contributor

florentx commented Jun 26, 2012

Thanks.

@florentx florentx closed this Jun 26, 2012

@smira smira added a commit to smira/pep8 that referenced this issue Jul 25, 2012

@smira smira Merge remote-tracking branch 'upstream/master'
* upstream/master: (169 commits)
  Fix false positive E401; issue #104.
  Add tests for issue #100.
  Fix false positive for continuation line indentation when line contains comments. Closes #100
  Fix issue with bpython. Closes #101
  Back to development.
  Fix crash, and release 1.3.3; issue #98.
  Release version 1.3.2.
  Add E902 errors for IOErrors; issue #87.
  Update README.
  A little bit of rewording.
  Revert to the pre-1.2 behavior: --show-pep8 does not imply --first; issue #89.
  Fix errors on E121 and E124; issue #92.
  Add changelog entries for issue #86 and issue #91.
  Fix the default configuration path on Windows. Issue #95.
  Back to development.
  Allow 'verbose' to be specified in the config file
  Clarify .pep can be located in any parent folder
  Show maximum length in "E501 line too long" error message
  Release version 1.3.1.
  Do not read the configuration when used as a module.
  ...

Conflicts:
	pep8.py
e8b0ecf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment