Conversation
|
We don't like these changes, look how it breaks the lines with the (.=) operator (both schema-profunctor and aeson) |
|
That result is really ugly. I think we might suffering from the same issue as here tweag/ormolu#892 |
|
I am disappointed that there is a
But, let's try it out anyway, hopefully people won't have diverging opinions on this 🤞 |
208c6fa to
f0f06a7
Compare
|
I've added the necessary overrides to |
| :- Capture "id" (GroupId tag) | ||
| :> Get '[SCIM] (StoredGroup tag), | ||
| :> Get '[SCIM] (StoredGroup tag), |
There was a problem hiding this comment.
Can this also be fixed with the .ormolu file?
| AssetToken <$> assetTokenAscii | ||
| .= schema | ||
| & doc' . S.schema . S.example ?~ toJSON ("aGVsbG8" :: Text) | ||
| AssetToken | ||
| <$> assetTokenAscii | ||
| .= schema | ||
| & doc' . S.schema . S.example ?~ toJSON ("aGVsbG8" :: Text) |
There was a problem hiding this comment.
Is this right? I am actually not sure if doc' is applied to schema or (AssetToken <$> assetTokenAcii .= schema). From the original code it looks like it is applied to schema, now it looks like that later.
There was a problem hiding this comment.
& is infixl 1 so it is applying to AssetToken <$> assetTokenAscii .= schema
| accept "application" "json" | ||
| .&> query "key" | ||
| .&. query "code" | ||
| .&. query "code" |
There was a problem hiding this comment.
This seems wrong, maybe .&> and .&. should be at the same fixity?
There was a problem hiding this comment.
Currently both are infixr 3, though it could be possible that Ormolu isn't picking that up? Prehaps we need to add them to the .ormolu file?
I don't understand why Ormolu wants to indent these lines. I can't come up with a logic that is consistent with how it handlles (: and ++) or (. and $) in other places.
That said, I really don't think "ugly" formatting should be a blocker for this task. If we need to change formatter, or add ORMOLU_DISABLE sections, or quiet hlint, or other we can take that up as an effort separate from aligning CI Ormolu with dev environment HLS/Ormolu.
Data.Schema is our definition of this. That file doesn't have a fixity declaration, which might be why Ormolu can't find it. We should probably add one, either at 4 (to match lens) or 8 (to match aeson). The "default" is |
stephen-smith
left a comment
There was a problem hiding this comment.
Changes are "fine".
New newer Ormolu adds more line breaks and indentation than I really like.
|
This accidentially reverted the submodule update in |
Motivation: Consistency with HLS, which uses the same version. That way if you use HLS for formatting you get the same result.
Ormolu now has formatting depending on the fixity of of operators, which it tries to parse out of files. Sometimes this approach fails that's why you can introduce overrides for fixities in .ormolu files which need to be next to .cabal files.
Without these overrides our reformatting is really ugly
These definitions are the same as in
Bilge.Assertsomehow ormolu was not able to read these fixities out of the module.
I don't know why we need this (it's not the same fixity as aeson defines it):
I would consider it a workaround.
Checklist