editorconfig / editorconfig-core-go

EditorConfig Core written in Go
MIT License
141 stars 32 forks source link

max_line_length support #45

Open greut opened 4 years ago

greut commented 4 years ago

Would it make sense to have a MaxLineLength int property where any off value would be translated to a 0.

https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#max_line_length

silverwind commented 4 years ago

Off value represented as a number should ideally be positive infinity but such values are always problematic in encodings like JSON, so I guess 0 is an acceptable compatibility approach.

greut commented 4 years ago

zero is the value that would work best with JSON serialization, assuming omitempty. You have always access to the raw values.

I'm supporting this in the linter although it could be brought back here as well if it helps anybody else. https://gitlab.com/greut/eclint/-/blob/master/definition.go#L59-70