Skip to content

records rule will sometimes cause records to start violating columns parameter #396

Open
@tysonzero

Description

@tysonzero

With the following config:

steps:
  - records:
      equals: "same_line"
      first_field: "indent 4"
      field_comment: 2
      deriving: 4
      via: "same_line"
      break_enums: true
      break_single_constructors: false
      curried_context: false
columns: 100

It converted our existing (desired) code:

data Api r = Api
    { _listDocuments :: r :- "list-documents"
        :> QueryParam' '[Required] "id" ThreadId
        :> Get '[JSON] [Document0]
    , _uploadDocument :: r :- "upload-document"
        :> QueryParam' '[Required] "id" DocumentId
        :> ReqBody '[JSON] MisoString
        :> Post '[JSON] ()
    } deriving (Generic)

To:

data Api r = Api
    { _listDocuments :: r :- "list-documents" :> QueryParam' '[Required] "id" ThreadId :> Get '[JSON] [Document0]
    , _uploadDocument :: r :- "upload-document" :> QueryParam' '[Required] "id" DocumentId :> ReqBody '[JSON] MisoString :> Post '[JSON] ()
    }
    deriving (Generic)

It would be nice if there was an option to leave the former alone.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions