{"action":"created","issue":{"url":"https://api.github.com/repos/prettier/prettier/issues/4314","repository_url":"https://api.github.com/repos/prettier/prettier","labels_url":"https://api.github.com/repos/prettier/prettier/issues/4314/labels{/name}","comments_url":"https://api.github.com/repos/prettier/prettier/issues/4314/comments","events_url":"https://api.github.com/repos/prettier/prettier/issues/4314/events","html_url":"https://github.com/prettier/prettier/issues/4314","id":314268485,"number":4314,"title":"Markdown table formatting causes merge conflicts.","user":{"login":"NodeGuy","id":2148537,"avatar_url":"https://avatars0.githubusercontent.com/u/2148537?v=4","gravatar_id":"","url":"https://api.github.com/users/NodeGuy","html_url":"https://github.com/NodeGuy","followers_url":"https://api.github.com/users/NodeGuy/followers","following_url":"https://api.github.com/users/NodeGuy/following{/other_user}","gists_url":"https://api.github.com/users/NodeGuy/gists{/gist_id}","starred_url":"https://api.github.com/users/NodeGuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NodeGuy/subscriptions","organizations_url":"https://api.github.com/users/NodeGuy/orgs","repos_url":"https://api.github.com/users/NodeGuy/repos","events_url":"https://api.github.com/users/NodeGuy/events{/privacy}","received_events_url":"https://api.github.com/users/NodeGuy/received_events","type":"User","site_admin":false},"labels":[{"id":717424485,"url":"https://api.github.com/repos/prettier/prettier/labels/lang:markdown","name":"lang:markdown","color":"006b75","default":false},{"id":516128597,"url":"https://api.github.com/repos/prettier/prettier/labels/status:needs%20discussion","name":"status:needs discussion","color":"5319e7","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-04-13T22:31:45Z","updated_at":"2018-04-17T00:27:43Z","closed_at":"2018-04-16T15:52:46Z","author_association":"NONE","body":"**Prettier 1.11.1**\r\n[Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAfABNO7UB0oYC0xO+GMA7hKQejABYBOc2etAZhAK6M0bsBLAG6sy6AM4CAHnwlwRUWXAEBzejFlQBUUbXiK2+EABoQEAA4wB0cclABDRowgUACo4S2U9oRAEATExB7cRhkdnsAG3E4UwAjRnswAGs4GABlcyTtFWQYRi5YkH8IMHComNNtGMYYV0SVAFt7cuiigCtxKQAhRJS09PtGuAAZbThWyrMuGHMZgCZJoqzGGuQQZsZkkoooIPNGbRgAdQCGZAAOAAZTA4gY48TzdYO4GpEg5gBHLgFmevsTRaSAibVMMUaAjyBSKkigKkicAAilwIPAlqYYPY4qd-OckPNMYkBJEcgBhCCNZrrKBYIJcGIAFWxXlBMQAvuygA)\r\n```sh\r\n--parser markdown\r\n```\r\n\r\n**Input:**\r\n```markdown\r\n| one |\r\n| --- |\r\n| two |\r\n| three |\r\n| four |\r\n| five |\r\n| six |\r\n| seven |\r\n| eight |\r\n| nine |\r\n| ten |\r\n```\r\n\r\n**Output:**\r\n```markdown\r\n| one   |\r\n| ----- |\r\n| two   |\r\n| three |\r\n| four  |\r\n| five  |\r\n| six   |\r\n| seven |\r\n| eight |\r\n| nine  |\r\n| ten   |\r\n```\r\n\r\nSuppose I check the above file into version control.  I later change row `three` to read `longer row three` and simultaneously a coworker changes only row `five` to `row five now has a wide column`.\r\n\r\nPrettier changes all of the rows in both tables:\r\n\r\n**Mine:**\r\n```markdown\r\n| one              |\r\n| ---------------- |\r\n| two              |\r\n| longer row three |\r\n| four             |\r\n| five             |\r\n| six              |\r\n| seven            |\r\n| eight            |\r\n| nine             |\r\n| ten              |\r\n```\r\n\r\n**Coworker's:**\r\n```markdown\r\n| one                            |\r\n| ------------------------------ |\r\n| two                            |\r\n| three                          |\r\n| four                           |\r\n| row five now has a wide column |\r\n| six                            |\r\n| seven                          |\r\n| eight                          |\r\n| nine                           |\r\n| ten                            |\r\n```\r\n\r\nWe changed different lines but because Prettier reformats the whole table, Git is unable to merge the changes automatically and now I'm scratching my head with a merge conflict, wondering exactly which rows my coworker changed (it's unclear).\r\n\r\nAs much as I like the prettier tables I propose we stop reformatting them because this is causing an unacceptable drag on my Git workflow.\r\n"},"comment":{"url":"https://api.github.com/repos/prettier/prettier/issues/comments/381791172","html_url":"https://github.com/prettier/prettier/issues/4314#issuecomment-381791172","issue_url":"https://api.github.com/repos/prettier/prettier/issues/4314","id":381791172,"user":{"login":"NodeGuy","id":2148537,"avatar_url":"https://avatars0.githubusercontent.com/u/2148537?v=4","gravatar_id":"","url":"https://api.github.com/users/NodeGuy","html_url":"https://github.com/NodeGuy","followers_url":"https://api.github.com/users/NodeGuy/followers","following_url":"https://api.github.com/users/NodeGuy/following{/other_user}","gists_url":"https://api.github.com/users/NodeGuy/gists{/gist_id}","starred_url":"https://api.github.com/users/NodeGuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NodeGuy/subscriptions","organizations_url":"https://api.github.com/users/NodeGuy/orgs","repos_url":"https://api.github.com/users/NodeGuy/repos","events_url":"https://api.github.com/users/NodeGuy/events{/privacy}","received_events_url":"https://api.github.com/users/NodeGuy/received_events","type":"User","site_admin":false},"created_at":"2018-04-17T00:27:43Z","updated_at":"2018-04-17T00:27:43Z","author_association":"NONE","body":"> I think most people would reformat the table similarly to how prettier does right now anyway, so you'd get a merge conflict even without prettier.\r\n\r\nThe team I just joined was formatting their tables like this before I imposed Prettier on them:\r\n\r\n```markdown\r\n| one | two | three |\r\n```\r\n\r\nThat's the way I've been doing it too before I joined the team.  Come to think of it, that's how I would prefer that Prettier do it.  It would solve the diff problem while still providing a canonical format.\r\n\r\n> FYI, there's an --ignore-all-space option to help you comparing changes.\r\n\r\nThank you, I wasn't aware of those Git options.  However, I don't want to force my whole team (plus open source contributors) to change the way they use Git.  I'm already forcing them to use Prettier.\r\n\r\n> This was discussed already in the original PR that added markdown support. Start reading from here: #2943 (comment)\r\n\r\nThank you, that conversation hadn't turned up in my previous search.\r\n\r\nThank you for all the suggestions and feedback.  Given the options I'm going to disable Prettier for Markdown files in my project."}}
{"actor":{"display_login":"NodeGuy"}}