-
Notifications
You must be signed in to change notification settings - Fork 4
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
Style fixes #4
Style fixes #4
Conversation
callback(String(line) + "\n"); | ||
else | ||
callback(imports.byteArray.toString(line) + "\n"); | ||
if (SHELL_VERSION <= SHELL_3_34) { |
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.
If you think 33400
isn't obvious enough, use getShellVersion("3.34.0")
instead.
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 trying to understand your reasoning... You are okay with saving getShellVersion(Config.PACKAGE_VERSION)
to a constant, but not okay with saving 33400
or getShellVersion("3.34.0")
to a constant?
Edit: For me it's not a matter of whether 33400
is obvious enough or not, I don't think having magic numbers in multiple places in the code is a good pattern.
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 just don't think that SHELL_3_34
is easier to understand than 33400
, which is also a constant. Maybe we can agree on this?
const SHELL_3_34 = getShellVersion("3.34.0");
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 just don't think that
SHELL_3_34
is easier to understand than33400
, which is also a constant.
If you accidentally deleted a character from SHELL_3_34
you would get an error during parsing/compilation. If you accidentally deleted a character from 33400
you would get an error during run-time (if you happen to trigger the right conditions to see the error).
Maybe we can agree on this?
That's fine, I'll make this change.
} | ||
|
||
function makeSimpleClass(BaseClass, getSuperArgs, initFn, name) { | ||
if (shellVersion < 33200) { | ||
if (SHELL_VERSION < SHELL_3_32) { |
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.
See above
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 no fan of your SHELL_3_32
constants. But otherwise, I'm fine with this PR.
Most of these changes were requested in p-e-w#127 (review) Other changes (line wrapping, const naming, additional consts) came from looking at the rest of the code.
e1ef586
to
ec7a2e2
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.
Looks good. I suppose you tested this?
Tested on GNOME Shell 3.38.4 (Ubuntu 21.04). |
Works on GNOME 41, too. LGTM. |
Most of these changes were requested in p-e-w#127 (review)
Other changes (line wrapping, const naming, additional consts) came from looking at the rest of the code.