-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code style fixes and guidelines #2019
Conversation
Removing the code duplication from |
What about a |
That would be a good thing to have, but I won't require it as part of this initial PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good to merge this as soon as we have any 8.0 bugs taken care of.
This PR includes various code style fixes that have been accumulating on my fork for a while. Most things are minor, like fixing typos in variable names, adjusting whitespace, or removing unnecessary parentheses, but there's also a couple instances where code duplication is removed, and replacing lists with tuples in the Python code should be a (very small) performance improvement.
I've also updated CI.py to include a few more checks and files. Where adding automated checks wasn't feasible, I've tried to formalize the changes I've made and some other existing conventions into a new document
Notes/code-style.md
. Here's my rationale for some of the guidelines that might be more controversial:and
insideor
: This formalizes existing practice in the codebase, especially in the logic files.This reflects the fact that inOverruled by the dev team.int *a, b
,b
is of typeint
, notint *
. Even though we currently don't use multiple variable declarations like this (at least as far as I'm aware), not being aware of this quirk of the language can lead to subtle bugs, so I think it's best not to obscure it with the formatting.