-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Update general guideline #746
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Valeria Graffeo <[email protected]> Co-authored-by: Rob Whittaker <[email protected]> Co-authored-by: Trésor Bireke <[email protected]>
eb96218
to
60e3c61
Compare
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.
This feels like a mix of multiple unrelated changes:
- Delete Hound guideline
- Move some guidelines out general
- Reformat part of general
- Change guideline on whitespace
Thoughts on making each of these their own commit? Maybe even their own PR? That would allow conversation to happen independently for each, and if one proves controversial then it doesn't block merging the others.
- Delete trailing whitespace. | ||
- Delete trailing spaces. |
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.
Whitespace is more than just spaces. It includes other invisible characters such as tabs, newlines, carriage returns or the unicode zero-width-joiner.
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.
Would "blank spaces" include these characters? Our main goal was to not use "whitespace".
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.
Maybe, but I think it's more ambiguous because some of the characters aren't spaces.
"Whitespace" seems to be the precise technical term used in e.g. the whatwg spec, the ECMAScript spec, or the Unicode spec to describe the class of characters (although they all define the set slightly differently).
Is "whitespace" in the context of characters and typography considered problematic?
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'd also want to ensure we're covering more than just trailing spaces as there's many other characters that one should avoid trailing a line.
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.
@JoelQ Not sure about being considered problematic but in our playbook and best practices chapter, we write:
Use negative space instead of white space.
Of course, it's important to consider the "environment" of where we use a terminology – I just feel if there is a more inclusive naming that captures the same intent, I would prefer using it.
@vburzynski How do you feel about adding these other characters we should avoid to this list?
- Don't misspell. | ||
- Use empty lines around multi-line blocks. | ||
- Use spaces around operators, except for unary operators, such as `!`. |
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 curious, why wouldn't one want to use spaces around operators? adding them in can improve readability/legibility. It also applies more broadly than just Ruby.
arr << 1
arr<<2
const result=1+1;
const other = 1 + 2;
EDIT: saw this was moved to ruby; I think this guidance would apply broadly to most if not all programming languages
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 with you and happy to move it back.
We updated the general guidelines and moved language specific guidelines to the relevant folders.
Co-authored-by: Valeria Graffeo [email protected]
Co-authored-by: Rob Whittaker [email protected]
Co-authored-by: Trésor Bireke [email protected]