-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Remove word duplicates in comments and strings, and fix casing and punctuation #88733
Remove word duplicates in comments and strings, and fix casing and punctuation #88733
Conversation
What regex did you use? Might be handy to re-run in the future as such issues slip through review. |
Hold off on this, I found more with a refined search.
Currently: For comments: //.*\b(\w+)\b\s+\1\b (There are some results I ignored like owner owner, because I didn't know if it meant owner's owner, I didn't want to get too nitpicky) For strings: (["'])(?:(?=(\?))\2.)?\b(\w+)\b(?:\s+\3\b)+(?:(?=(\?))\4.)?\1 Error messages: MSG(["'][a-z].*["']) |
1dcafea
to
e7c832f
Compare
@@ -661,7 +661,7 @@ class VariantConstructNoArgsNil { | |||
VariantInternal::clear(r_ret); | |||
} | |||
static void ptr_construct(void *base, const void **p_args) { | |||
ERR_FAIL_MSG("can't ptrcall nil constructor"); | |||
ERR_FAIL_MSG("Cannot ptrcall nil constructor"); |
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.
Regex for MSG( starting with lower case, updated a few to fit other messages I found.
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.
While at it, error messages should also end with a dot.
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.
What about exclamation points? Should these become "." to be consistent? To me all errors are equally exciting.
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.
In most cases yeah, the exclamation mark might be overdoing it a bit. But that might imply further improving the phrasing for consistency with other similar errors, which may be outside the scope of this 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.
Understood. Leaving them alone for now.
joint_one_bone2d_node_cache = node->get_instance_id(); | ||
|
||
Bone2D *bone = Object::cast_to<Bone2D>(node); | ||
if (bone) { | ||
joint_one_bone_idx = bone->get_index_in_skeleton(); | ||
} else { | ||
ERR_FAIL_MSG("update joint one Bone2D cache: Nodepath to Bone2D is not a Bone2D node!"); |
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.
Lower case to upper case.
da4f508
to
bd8ea9b
Compare
core/io/dir_access.h
Outdated
ERR_FAIL_MSG("Cannot remove file or directory: " + p_path + "."); | ||
} | ||
} else { | ||
ERR_FAIL_MSG("Cannot remove non-existent file or directory: " + p_path); | ||
ERR_FAIL_MSG("Cannot remove non-existent file or directory: " + p_path + "."); |
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 think in this case, the omission was intentional, to avoid confusion at to whether the dot is part of the file path or not.
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.
Oops, yeah that makes sense. I should avoid doing it to file paths. Agreed.
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.
There are existing examples of adding the period at the end of the path. Would you like me to remove those?
godot/core/config/project_settings.cpp
Line 1096 in 87d40ba
ERR_FAIL_V_MSG(ERR_FILE_UNRECOGNIZED, "Unknown config file format: " + p_path + "."); |
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.
What's most commonly used currently?
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.
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.
Let's standardize on no dots for these then.
610e331
to
dd623b7
Compare
dd623b7
to
a205717
Compare
@@ -1860,7 +1860,7 @@ void RenderingDeviceDriverD3D12::command_pipeline_barrier( | |||
VectorView<RDD::BufferBarrier> p_buffer_barriers, | |||
VectorView<RDD::TextureBarrier> p_texture_barriers) { | |||
if (p_src_stages.has_flag(PIPELINE_STAGE_ALL_COMMANDS_BIT) && p_dst_stages.has_flag(PIPELINE_STAGE_ALL_COMMANDS_BIT)) { | |||
// Looks like the intent is a a full barrier. |
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.
Rebased to fix recent merge conflict and found another one in the process.
a205717
to
13e8209
Compare
@@ -1597,7 +1597,7 @@ void ED_SHORTCUT_OVERRIDE(const String &p_path, const String &p_feature, Key p_k | |||
ERR_FAIL_NULL_MSG(EditorSettings::get_singleton(), "EditorSettings not instantiated yet."); | |||
|
|||
Ref<Shortcut> sc = EditorSettings::get_singleton()->get_shortcut(p_path); | |||
ERR_FAIL_COND_MSG(!sc.is_valid(), "Used ED_SHORTCUT_OVERRIDE with invalid shortcut: " + p_path + "."); | |||
ERR_FAIL_COND_MSG(!sc.is_valid(), "Used ED_SHORTCUT_OVERRIDE with invalid shortcut: " + p_path); |
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 don't understand, are error messages with paths meant to end with, or without punctuation? What's the rule here?
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.
My understanding is without: #88733 (comment)
Thanks! |
Used regex to find these. Ignored third party files.
Fixes: #88711