{"action":"opened","issue":{"url":"https://api.github.com/repos/sol/hpack/issues/341","repository_url":"https://api.github.com/repos/sol/hpack","labels_url":"https://api.github.com/repos/sol/hpack/issues/341/labels{/name}","comments_url":"https://api.github.com/repos/sol/hpack/issues/341/comments","events_url":"https://api.github.com/repos/sol/hpack/issues/341/events","html_url":"https://github.com/sol/hpack/issues/341","id":377420063,"node_id":"MDU6SXNzdWUzNzc0MjAwNjM=","number":341,"title":"Add a format command.","user":{"login":"philderbeast","id":633283,"node_id":"MDQ6VXNlcjYzMzI4Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/633283?v=4","gravatar_id":"","url":"https://api.github.com/users/philderbeast","html_url":"https://github.com/philderbeast","followers_url":"https://api.github.com/users/philderbeast/followers","following_url":"https://api.github.com/users/philderbeast/following{/other_user}","gists_url":"https://api.github.com/users/philderbeast/gists{/gist_id}","starred_url":"https://api.github.com/users/philderbeast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philderbeast/subscriptions","organizations_url":"https://api.github.com/users/philderbeast/orgs","repos_url":"https://api.github.com/users/philderbeast/repos","events_url":"https://api.github.com/users/philderbeast/events{/privacy}","received_events_url":"https://api.github.com/users/philderbeast/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-05T14:19:18Z","updated_at":"2018-11-05T14:19:18Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Please add a `format` command to hpack with an `--inplace` option to overwrite the `package.yaml` file.\r\n\r\n    hpack format --inplace\r\n\r\n> * When using Dhall it's more likely that you get git conflicts when rebasing/merging (yes, commas again)\r\nSOURCE: https://github.com/BlockScope/hpack-dhall/issues/3#issuecomment-418572726\r\n\r\nIf a `format` command was added to hpack then use of this command could help to reduce the chance of git conflicts when rebasing/merging.\r\n\r\n### Differences\r\n\r\nI'm currently adding some real world golden tests for the executable `dhall-hpack-yaml` from package `hpack-dhall`, trying to generate output that matches hpack's `package.yaml` and stack's `package.yaml`. The kinds of differences I've seen between handwritten and generated `package.yaml` files are;\r\n\r\n* Indentation\r\n```\r\ndependencies:\r\n- base >= 4.9 && < 5\r\n- bytestring\r\n\r\ndependencies:\r\n  - base >= 4.9 && < 5\r\n  - bytestring\r\n```\r\n* Field order\r\n```\r\ncategory: Development\r\nmaintainer: Simon Hengel <sol@typeful.net>\r\nextra-source-files: CHANGELOG.md\r\ngithub: sol/hpack\r\n\r\nmaintainer: Simon Hengel <sol@typeful.net>\r\ngithub: sol/hpack\r\ncategory: Development\r\nextra-source-files:\r\n  - CHANGELOG.md\r\n```\r\n* Single element lists\r\n```\r\ndependencies: hpack\r\n\r\ndependencies:\r\n    - hpack\r\n```\r\n* Empty lines\r\n```\r\nexecutable:\r\n  source-dirs: driver\r\n  dependencies: hpack\r\n  main: Main.hs\r\ntests:\r\n  spec:\r\n\r\nexecutable:\r\n  main: Main.hs\r\n  source-dirs: driver\r\n  dependencies:\r\n    - hpack\r\n\r\ntests:\r\n  spec:\r\n```\r\n* Version numbers\r\n```\r\nname: stack\r\nversion: ! '''1.10.0'''\r\n\r\nname: stack\r\nversion: '1.10.0'\r\n\r\nname: hpack\r\nversion: 0.31.1\r\n```\r\n\r\n"}}
{"actor":{"display_login":"philderbeast"}}