arnetheduck / nph

An opinionated code formatter for Nim
Other
77 stars 12 forks source link

88 characters doesn't count ` =` in routine definitions #50

Closed emizzle closed 4 months ago

emizzle commented 4 months ago

The formatter doesn't seem to add line breaks in routine definitions until there are >88 characters without including =. For example,

# nph doesn't add line breaks
# 88 characters without including ` =`
template expectJsonKind*(expectedType: type, expectedKind: JsonNodeKind, json: JsonNode) =
  expectJsonKind(expectedType, {expectedKind}, json)

# nph adds line breaks
# 89 characters without including ` =`
template expectJsonKind*(expectedType: type, expectedKind: JsonNodeKind, json1: JsonNode) =
  expectJsonKind(expectedType, {expectedKind}, json1)

It would make sense to include = in the character count as part of the routine definition as these are visible characters and one should not have to scroll to see them.