arnetheduck / nph

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

Enum string value does not get a newline when char limit is reached. #54

Closed kdeme closed 4 months ago

kdeme commented 4 months ago

Not a bug, but rather a suggestion / potential improvement:

type SomeEnum* = enum
  someEnum =
    "A long enough piece of text to make sure we reach the character per line limit."
  someEnumWithMuchLongerName =
    "A long enough piece of text to make sure we reach the character per line limit."
  someOtherEnum =
    "A long enough piece of text to make sure we reach the character per line limit."

const
  oneString =
    "A long enough piece of text to make sure we reach the character per line limit."
  oneStringWithMuchLongerName =
    "A long enough piece of text to make sure we reach the character per line limit."
  oneOtherString =
    "A long enough piece of text to make sure we reach the character per line limit."

Becomes formatted:

type SomeEnum* = enum
  someEnum = "A long enough piece of text to make sure we reach the character per line limit."
  someEnumWithMuchLongerName = "A long enough piece of text to make sure we reach the character per line limit."
  someOtherEnum = "A long enough piece of text to make sure we reach the character per line limit."

const
  oneString =
    "A long enough piece of text to make sure we reach the character per line limit."
  oneStringWithMuchLongerName =
    "A long enough piece of text to make sure we reach the character per line limit."
  oneOtherString =
    "A long enough piece of text to make sure we reach the character per line limit."

I'm not fully sure about this one, but I think style wise I like it more when the enum strings also move to a newline like is done for other strings.