{"action":"created","issue":{"url":"https://api.github.com/repos/godotengine/godot/issues/6980","repository_url":"https://api.github.com/repos/godotengine/godot","labels_url":"https://api.github.com/repos/godotengine/godot/issues/6980/labels{/name}","comments_url":"https://api.github.com/repos/godotengine/godot/issues/6980/comments","events_url":"https://api.github.com/repos/godotengine/godot/issues/6980/events","html_url":"https://github.com/godotengine/godot/issues/6980","id":186147172,"number":6980,"title":"Coding standards: Python files","user":{"login":"akien-mga","id":4701338,"avatar_url":"https://avatars.githubusercontent.com/u/4701338?v=3","gravatar_id":"","url":"https://api.github.com/users/akien-mga","html_url":"https://github.com/akien-mga","followers_url":"https://api.github.com/users/akien-mga/followers","following_url":"https://api.github.com/users/akien-mga/following{/other_user}","gists_url":"https://api.github.com/users/akien-mga/gists{/gist_id}","starred_url":"https://api.github.com/users/akien-mga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akien-mga/subscriptions","organizations_url":"https://api.github.com/users/akien-mga/orgs","repos_url":"https://api.github.com/users/akien-mga/repos","events_url":"https://api.github.com/users/akien-mga/events{/privacy}","received_events_url":"https://api.github.com/users/akien-mga/received_events","type":"User","site_admin":false},"labels":[{"id":279097162,"url":"https://api.github.com/repos/godotengine/godot/labels/discussion","name":"discussion","color":"ee77ee","default":false},{"id":283518839,"url":"https://api.github.com/repos/godotengine/godot/labels/documentation","name":"documentation","color":"ffbbff","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-30T16:45:36Z","updated_at":"2016-10-30T17:02:36Z","closed_at":null,"body":"As a monolithic issue (#3916) does not make it easy to discuss specific points, let's split some topics in their own issue (always referencing the main one) so that we can progress forwards.\r\n\r\n----\r\n\r\nWe have various Python files in the source, mostly related to the buildsystem or some helper scripts.\r\n\r\nI'd propose to follow the Python standard for those, PEP 8: https://www.python.org/dev/peps/pep-0008/\r\nThe main disruptive change of PEP 8 for us would be that it enforces space indentation (:innocent:), while we currently have a stronger tendency to use tabs (though it's not done consistently and we have a lot of mixed situations).\r\n\r\nSince most auto-formatting tools enforce spaces, I'd propose to use that convention too for our Python files (not C++ of course, where we should stick to our *de facto* tabs standard).\r\n\r\nAlternatively, we can decide to use PEP 8 and tabs for indentation, we just need to tweak the PEP 8 checking tools to disable some warnings and errors related to indentation. One advantage of keeping tabs is that we're consistent with the C++ code, so we don't have issues with conflicting IDE configs."},"comment":{"url":"https://api.github.com/repos/godotengine/godot/issues/comments/257163535","html_url":"https://github.com/godotengine/godot/issues/6980#issuecomment-257163535","issue_url":"https://api.github.com/repos/godotengine/godot/issues/6980","id":257163535,"user":{"login":"akien-mga","id":4701338,"avatar_url":"https://avatars.githubusercontent.com/u/4701338?v=3","gravatar_id":"","url":"https://api.github.com/users/akien-mga","html_url":"https://github.com/akien-mga","followers_url":"https://api.github.com/users/akien-mga/followers","following_url":"https://api.github.com/users/akien-mga/following{/other_user}","gists_url":"https://api.github.com/users/akien-mga/gists{/gist_id}","starred_url":"https://api.github.com/users/akien-mga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akien-mga/subscriptions","organizations_url":"https://api.github.com/users/akien-mga/orgs","repos_url":"https://api.github.com/users/akien-mga/repos","events_url":"https://api.github.com/users/akien-mga/events{/privacy}","received_events_url":"https://api.github.com/users/akien-mga/received_events","type":"User","site_admin":false},"created_at":"2016-10-30T17:02:36Z","updated_at":"2016-10-30T17:02:36Z","body":"Let's go with spaces then.\r\n\r\nOne thing not covered by pep8 (or at least not touched by `autopep8`) is the use of parenthesis around conditionals:\r\n```\r\nif (cond):\r\n    do_stuff()\r\n```\r\nvs\r\n```\r\nif cond:\r\n    do_stuff()\r\n```\r\n\r\nWhich one do we want to enforce? I think the 2nd one is more idiomatic python, but the former one is currently used more often as the buildsystem was written by C++ guys :)"}}
{"actor":{"display_login":"akien-mga"}}