Skip to content
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

Fix typos with codespell #28997

Merged
merged 1 commit into from
May 19, 2019
Merged

Fix typos with codespell #28997

merged 1 commit into from
May 19, 2019

Conversation

akien-mga
Copy link
Member

Using codespell 1.15.0.

Method:

$ cat > ../godot-word-whitelist.txt << EOF
ang
curvelinear
doubleclick
leapyear
lod
merchantibility
nd
numer
ois
ony
que
seeked
synching
te
uint
unselect
webp
EOF

$ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"
$ git diff // undo unwanted changes

@akien-mga
Copy link
Member Author

seeked

This is incorrect grammatically (past participle of "seek" is "sought"), but used in our Animation API:

diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml
index c1307be92..ddba14c4b 100644
--- a/doc/classes/AnimationNode.xml
+++ b/doc/classes/AnimationNode.xml
@@ -28,7 +28,7 @@
 			</argument>
 			<argument index="2" name="delta" type="float">
 			</argument>
-			<argument index="3" name="seeked" type="bool">
+			<argument index="3" name="sought" type="bool">
 			</argument>
 			<argument index="4" name="blend" type="float">
 			</argument>
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index a5955d57f..508a15640 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -810,9 +810,9 @@ void AnimationPlayer::_animation_process2(float p_delta, bool p_started) {
 
 	accum_pass++;
 
-	_animation_process_data(c.current, p_delta, 1.0f, c.seeked && p_delta != 0, p_started);
+	_animation_process_data(c.current, p_delta, 1.0f, c.sought && p_delta != 0, p_started);
 	if (p_delta != 0) {
-		c.seeked = false;
+		c.sought = false;
 	}
 
 	List<Blend>::Element *prev = NULL;
@@ -1207,7 +1207,7 @@ void AnimationPlayer::play(const StringName &p_name, float p_custom_blend, float
 
 	c.current.speed_scale = p_custom_scale;
 	c.assigned = name;
-	c.seeked = false;
+	c.sought = false;
 	c.started = true;
 
 	if (!end_reached)
@@ -1319,7 +1319,7 @@ void AnimationPlayer::seek(float p_time, bool p_update) {
 	}
 
 	playback.current.pos = p_time;
-	playback.seeked = true;
+	playback.sought = true;
 	if (p_update) {
 		_animation_process(0);
 	}
@@ -1364,7 +1364,7 @@ void AnimationPlayer::_animation_changed() {
 	clear_caches();
 	emit_signal("caches_cleared");
 	if (is_playing()) {
-		playback.seeked = true; //need to restart stuff, like audio
+		playback.sought = true; //need to restart stuff, like audio
 	}
 }
 
@@ -1693,7 +1693,7 @@ AnimationPlayer::AnimationPlayer() {
 	root = SceneStringNames::get_singleton()->path_pp;
 	playing = false;
 	active = true;
-	playback.seeked = false;
+	playback.sought = false;
 	playback.started = false;
 }
 
diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h
index fea481982..0b90b431c 100644
--- a/scene/animation/animation_player.h
+++ b/scene/animation/animation_player.h
@@ -235,7 +235,7 @@ private:
 		List<Blend> blend;
 		PlaybackData current;
 		StringName assigned;
-		bool seeked;
+		bool sought;
 		bool started;
 	} playback;
 
diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp
index d1d3582c9..9b7ea0510 100644
--- a/scene/animation/animation_tree.cpp
+++ b/scene/animation/animation_tree.cpp
@@ -114,7 +114,7 @@ void AnimationNode::blend_animation(const StringName &p_animation, float p_time,
 	anim_state.delta = p_delta;
 	anim_state.time = p_time;
 	anim_state.animation = animation;
-	anim_state.seeked = p_seeked;
+	anim_state.sought = p_seeked;
 
 	state->animation_states.push_back(anim_state);
 }
@@ -419,7 +419,7 @@ void AnimationNode::_bind_methods() {
 	ClassDB::bind_method(D_METHOD("_set_filters", "filters"), &AnimationNode::_set_filters);
 	ClassDB::bind_method(D_METHOD("_get_filters"), &AnimationNode::_get_filters);
 
-	ClassDB::bind_method(D_METHOD("blend_animation", "animation", "time", "delta", "seeked", "blend"), &AnimationNode::blend_animation);
+	ClassDB::bind_method(D_METHOD("blend_animation", "animation", "time", "delta", "sought", "blend"), &AnimationNode::blend_animation);
 	ClassDB::bind_method(D_METHOD("blend_node", "name", "node", "time", "seek", "blend", "filter", "optimize"), &AnimationNode::blend_node, DEFVAL(FILTER_IGNORE), DEFVAL(true));
 	ClassDB::bind_method(D_METHOD("blend_input", "input_index", "time", "seek", "blend", "filter", "optimize"), &AnimationNode::blend_input, DEFVAL(FILTER_IGNORE), DEFVAL(true));
 
@@ -852,7 +852,7 @@ void AnimationTree::_process_graph(float p_delta) {
 			Ref<Animation> a = as.animation;
 			float time = as.time;
 			float delta = as.delta;
-			bool seeked = as.seeked;
+			bool sought = as.sought;
 
 			for (int i = 0; i < a->get_track_count(); i++) {
 
@@ -1053,7 +1053,7 @@ void AnimationTree::_process_graph(float p_delta) {
 
 						TrackCacheAudio *t = static_cast<TrackCacheAudio *>(track);
 
-						if (seeked) {
+						if (sought) {
 							//find whathever should be playing
 							int idx = a->track_find_key(i, time);
 							if (idx < 0)
@@ -1162,7 +1162,7 @@ void AnimationTree::_process_graph(float p_delta) {
 						if (!player2)
 							continue;
 
-						if (delta == 0 || seeked) {
+						if (delta == 0 || sought) {
 							//seek
 							int idx = a->track_find_key(i, time);
 							if (idx < 0)
@@ -1184,7 +1184,7 @@ void AnimationTree::_process_graph(float p_delta) {
 								at_anim_pos = MAX(anim->get_length(), time - pos); //seek to end
 							}
 
-							if (player2->is_playing() || seeked) {
+							if (player2->is_playing() || sought) {
 								player2->play(anim_name);
 								player2->seek(at_anim_pos);
 								t->playing = true;
diff --git a/scene/animation/animation_tree.h b/scene/animation/animation_tree.h
index 4c65b2a92..4c39bec58 100644
--- a/scene/animation/animation_tree.h
+++ b/scene/animation/animation_tree.h
@@ -68,7 +68,7 @@ public:
 		float delta;
 		const Vector<float> *track_blends;
 		float blend;
-		bool seeked;
+		bool sought;
 	};
 
 	struct State {

We could change it without breaking compat a priori (it's just an argument name in the scripting API), but I don't know if an argument named "sought" would be clear enough for people who are not native English speakers but familiar with the concept of "seeking" computer streams.

unselect

That should be replaced by "deselect" for 4.0, it's already mentioned in #16863.

Using codespell 1.15.0.

Method:
```
$ cat > ../godot-word-whitelist.txt << EOF
ang
curvelinear
doubleclick
leapyear
lod
merchantibility
nd
numer
ois
ony
que
seeked
synching
te
uint
unselect
webp
EOF

$ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"
$ git diff // undo unwanted changes
```
@akien-mga
Copy link
Member Author

I wanted to fix the typo in UndoRedo::is_commiting_action, but it's bound to scripting languages and was added just before the 3.1 release, so renaming it now would break compat with 3.1. This will thus have to wait for 4.0 (will add to #16863).

@bojidar-bg
Copy link
Contributor

Can't it get a deprecated old version which calls the new name?

@akien-mga
Copy link
Member Author

It could, but I'm lazy :P

@akien-mga akien-mga merged commit a940b4c into godotengine:master May 19, 2019
@akien-mga akien-mga deleted the codespell branch May 19, 2019 20:04
@@ -111,7 +111,7 @@ void DocDump::dump(const String &p_file) {

for (List<MethodInfo>::Element *E = method_list.front(); E; E = E->next()) {
if (E->get().name == "" || E->get().name[0] == '_')
continue; //hiden
continue; //hidden
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should consider requiring a consistent format for these. Instead of //hidden it should be // Hidden

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aaronfranke I made an issue that talked about that and other code inconsistencies some time ago, pretty much went nowhere: #16521

@akien-mga
Copy link
Member Author

Too many conflicts, not cherrypicking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants