{"action":"created","issue":{"url":"https://api.github.com/repos/nim-lang/Nim/issues/9502","repository_url":"https://api.github.com/repos/nim-lang/Nim","labels_url":"https://api.github.com/repos/nim-lang/Nim/issues/9502/labels{/name}","comments_url":"https://api.github.com/repos/nim-lang/Nim/issues/9502/comments","events_url":"https://api.github.com/repos/nim-lang/Nim/issues/9502/events","html_url":"https://github.com/nim-lang/Nim/issues/9502","id":373751330,"node_id":"MDU6SXNzdWUzNzM3NTEzMzA=","number":9502,"title":"nimpretty should hardcode indentation amount to 2 spaces","user":{"login":"timotheecour","id":2194784,"node_id":"MDQ6VXNlcjIxOTQ3ODQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2194784?v=4","gravatar_id":"","url":"https://api.github.com/users/timotheecour","html_url":"https://github.com/timotheecour","followers_url":"https://api.github.com/users/timotheecour/followers","following_url":"https://api.github.com/users/timotheecour/following{/other_user}","gists_url":"https://api.github.com/users/timotheecour/gists{/gist_id}","starred_url":"https://api.github.com/users/timotheecour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timotheecour/subscriptions","organizations_url":"https://api.github.com/users/timotheecour/orgs","repos_url":"https://api.github.com/users/timotheecour/repos","events_url":"https://api.github.com/users/timotheecour/events{/privacy}","received_events_url":"https://api.github.com/users/timotheecour/received_events","type":"User","site_admin":false},"labels":[{"id":66122,"node_id":"MDU6TGFiZWw2NjEyMg==","url":"https://api.github.com/repos/nim-lang/Nim/labels/Feature","name":"Feature","color":"0080f0","default":false},{"id":1094566740,"node_id":"MDU6TGFiZWwxMDk0NTY2NzQw","url":"https://api.github.com/repos/nim-lang/Nim/labels/nimpretty","name":"nimpretty","color":"ffcab7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-10-25T02:47:09Z","updated_at":"2018-10-25T10:08:49Z","closed_at":null,"author_association":"COLLABORATOR","body":"nimpretty currently applies to rest of file the 1st indentation it finds; in following case it uses an indentation of 1 space instead of usual 2:\r\n\r\n```nim\r\nproc foo1() =\r\n echo \"bar\"\r\n\r\nproc foo2() =\r\n  echo \"bar\"\r\n```\r\nnimpretty output:\r\n```nim\r\nproc foo1() =\r\n echo \"bar\"\r\n\r\nproc foo2() =\r\n echo \"bar\"\r\n```\r\n\r\nI understand this may be by design but is that a good idea? especially if nimpretty is meant as a 0-config indentation tool? that'll lead to potential fragmentation of styles and larger diffs down the line, eg: if a user adds a different indentation as the very 1st proc in a file, the next time nimpretty is applied, a large diff will result (changing indentation everywhere in the file).\r\n\r\n## proposal\r\nhardcode indentation of 2 spaces, used throughout Nim codebase and large majority of nimble packages\r\nI don't see any disadvantage to using 2 spaces\r\n"},"comment":{"url":"https://api.github.com/repos/nim-lang/Nim/issues/comments/432993795","html_url":"https://github.com/nim-lang/Nim/issues/9502#issuecomment-432993795","issue_url":"https://api.github.com/repos/nim-lang/Nim/issues/9502","id":432993795,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjk5Mzc5NQ==","user":{"login":"b3liever","id":43617260,"node_id":"MDQ6VXNlcjQzNjE3MjYw","avatar_url":"https://avatars3.githubusercontent.com/u/43617260?v=4","gravatar_id":"","url":"https://api.github.com/users/b3liever","html_url":"https://github.com/b3liever","followers_url":"https://api.github.com/users/b3liever/followers","following_url":"https://api.github.com/users/b3liever/following{/other_user}","gists_url":"https://api.github.com/users/b3liever/gists{/gist_id}","starred_url":"https://api.github.com/users/b3liever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/b3liever/subscriptions","organizations_url":"https://api.github.com/users/b3liever/orgs","repos_url":"https://api.github.com/users/b3liever/repos","events_url":"https://api.github.com/users/b3liever/events{/privacy}","received_events_url":"https://api.github.com/users/b3liever/received_events","type":"User","site_admin":false},"created_at":"2018-10-25T10:08:49Z","updated_at":"2018-10-25T10:08:49Z","author_association":"NONE","body":"Come on its fine as it is..."}}
{"actor":{"display_login":"b3liever"}}