notslang / editorconfig-tools

Tools for verifying/fixing code style based on an EditorConfig file
https://npmjs.com/package/editorconfig-tools
GNU General Public License v3.0
54 stars 6 forks source link

Update `max_line_length` to allow 0 length lines #26

Open whitneyit opened 9 years ago

whitneyit commented 9 years ago

The max_line_length currently does not support setting a length to 0.

As the docs say, this rule is supported by both vim and emacs that use 0 to indicate that there is no max_line_length. You can see this being demonstrated in the editorconfig-vim repo.

This PR stops a value of 0 in max_line_length from throwing an Error.

notslang commented 9 years ago

:-1: ... you should use max_line_length = null if you want to indicate that there is no max line length. ref: https://github.com/editorconfig/editorconfig/issues/165

whitneyit commented 9 years ago

I would have to disagree. As xuhdev said

We didn't specify a suggested value to nullify a property though

notslang commented 9 years ago

Yes, there isn't one specific value to nullify a property - any undefined value will work. But zero is a valid value - it requires that all lines in the file are blank. It's a pretty strange value, but it's certainly enforceable and well-defined.

whitneyit commented 9 years ago

In which editor would 0 require all lines to be blank? Sublime, vim and emacs consider that to mean no max length.

On Sun, 13 Sep 2015 15:52 Sean Lang notifications@github.com wrote:

Yes, there isn't one specific value to nullify a property - any undefined value will work. But zero is a valid value - it requires that all lines in the file are blank. It's a pretty strange value, but it's certainly enforceable and well-defined.

— Reply to this email directly or view it on GitHub https://github.com/slang800/editorconfig-tools/pull/26#issuecomment-139846044 .