Skip to content

Commit c4b93cf

Browse files
Added codespell as a pre-commit hook. (#977)
Signed-off-by: Leander Stephen D'Souza <[email protected]>
1 parent 7ffab7e commit c4b93cf

32 files changed

+74
-55
lines changed

.codespell_ignore_words

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
INOUT
2+
InOut
3+
delimeter
4+
Succesful
5+
worl
6+
valu
7+
Exeption

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,13 @@ repos:
4242
hooks:
4343
- id: clang-format
4444
args: ['-fallback-style=none', '-i']
45+
46+
# Spell check
47+
- repo: https://github.com/codespell-project/codespell
48+
rev: v2.4.1
49+
hooks:
50+
- id: codespell
51+
additional_dependencies:
52+
- tomli
53+
args:
54+
[--toml=./pyproject.toml]

CHANGELOG.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Changelog for package behaviortree_cpp
1717
* Fix dangling‐capture in TestNodeConfig
1818
* Fix Precondition to only check condition once (`#904 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/904>`_)
1919
* fix issue 945
20-
* extend JSON convertion to include vectors (`#965 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/965>`_)
20+
* extend JSON conversion to include vectors (`#965 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/965>`_)
2121
* Fix CI, add BUILD_TESTS and remove catkin support
2222
* Fix testing CMake issue to resolve Rolling regression (`#961 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/961>`_)
2323
* Bug fix/set blackboard (`#955 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/955>`_)
@@ -116,7 +116,7 @@ Changelog for package behaviortree_cpp
116116
* warn about overwritten enums
117117
* fix ambiguous to_json
118118
* Extend unit test for blackboard backup to run the second tree (`#789 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/789>`_)
119-
* json convertion changed and
119+
* json conversion changed and
120120
* issue `#755 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/755>`_ : add backchaining test and change reactive nodes checks (`#770 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/770>`_)
121121
* Update switch_node.h
122122
* test moved and port remapping fixed
@@ -393,7 +393,7 @@ Changelog for package behaviortree_cpp
393393
* better include paths
394394
* Control node and Decorators RUNNING before first child
395395
* blackboard: update getKeys and add mutex to scripting
396-
* add [[nodiscard]] and some othe minor changes
396+
* add [[nodiscard]] and some other minor changes
397397
* add screenshot
398398
* change the behavior of tickOnce to actually loop is wake up signal is… (`#522 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/522>`_)
399399
* change the behavior of tickOnce to actually loop is wake up signal is received
@@ -492,7 +492,7 @@ Changelog for package behaviortree_cpp
492492
dependency explicitly.
493493
* Change order of lock to prevent deadlock. (`#368 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/368>`_)
494494
Resolves `#367 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/367>`_.
495-
* Fix `#320 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/320>`_ : forbit refrences in Any
495+
* Fix `#320 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/320>`_ : forbid references in Any
496496
* Update action_node.h
497497
* Contributors: Adam Sasine, Davide Faconti, Fabian Schurig, Griswald Brooks, Hyeongsik Min, Robodrome, imgbot[bot], panwauu
498498

@@ -839,9 +839,9 @@ Changelog for package behaviortree_cpp
839839
* Conan package distribution (#39)
840840
* Non-functional refactoring of xml_parsing to clean up the code
841841
* cosmetic changes in the code of BehaviorTreeFactory
842-
* XML schema. Related to enchancement #40
842+
* XML schema. Related to enhancement #40
843843
* call setRegistrationName() for built-in Nodes
844-
The methos is called by BehaviorTreefactory, therefore it
844+
The method is called by BehaviorTreefactory, therefore it
845845
registrationName is empty if trees are created programmatically.
846846
* Reset reference count when destroying logger (issue #38)
847847
* Contributors: Davide Facont, Davide Faconti, Uilian Ries
@@ -857,7 +857,7 @@ Changelog for package behaviortree_cpp
857857
------------------
858858
* adding virtual TreeNode::onInit() [issue #33]
859859
* fix issue #34 : if you don't implement convertFromString, it will compile but it may throw
860-
* Pretty demangled names and obsolate comments removed
860+
* Pretty demangled names and obsolete comments removed
861861
* bug fixes
862862
* more comments
863863
* [enhancement #32]: add CoroActionNode and rename ActionNode as "AsynActionNode"
@@ -924,7 +924,7 @@ Changelog for package behaviortree_cpp
924924
* Fix: registerBuilder did not register the manifest. It was "broken" as public API method
925925
* Use the Pimpl idiom to hide zmq from the header file
926926
* move header of minitrace in the cpp file
927-
* Fixed a crash occuring when you didn't initialized a Tree object (#20)
927+
* Fixed a crash occurring when you didn't initialized a Tree object (#20)
928928
* Fix issue #16
929929
* add ParallelNode to pre-registered entries in factory (issue #13)
930930
* removed M_PI

cmake/conan.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ macro(_conan_check_language)
116116
set(LANGUAGE C)
117117
set(USING_CXX 0)
118118
else ()
119-
message(FATAL_ERROR "Conan: Neither C or C++ was detected as a language for the project. Unabled to detect compiler version.")
119+
message(FATAL_ERROR "Conan: Neither C or C++ was detected as a language for the project. Unable to detect compiler version.")
120120
endif()
121121
endmacro()
122122

@@ -1050,7 +1050,7 @@ macro(conan_config_install)
10501050
endif()
10511051

10521052
if(DEFINED CONAN_ARGS)
1053-
# Convert ; seperated multi arg list into space seperated string
1053+
# Convert ; separated multi arg list into space separated string
10541054
string(REPLACE ";" " " l_CONAN_ARGS "${CONAN_ARGS}")
10551055
set(CONAN_ARGS_ARGS "--args=${l_CONAN_ARGS}")
10561056
endif()

examples/t12_default_ports.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ struct Point2D
2222
}
2323
};
2424

25-
// Allow bi-directional convertion to JSON
25+
// Allow bi-directional conversion to JSON
2626
BT_JSON_CONVERTER(Point2D, point)
2727
{
2828
add_field("x", &point.x);

examples/t15_nodes_mocking.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ int main(int argc, char** argv)
147147
factory.loadSubstitutionRuleFromJSON(json_text);
148148
}
149149
//---------------------------------------------------------------
150-
// IMPORTANT: all substiutions must be done BEFORE creating the tree
150+
// IMPORTANT: all substitutions must be done BEFORE creating the tree
151151
// During the construction phase of the tree, the substitution
152152
// rules will be used to instantiate the test nodes, instead of the
153153
// original ones.
@@ -158,7 +158,7 @@ int main(int argc, char** argv)
158158
return 0;
159159
}
160160

161-
/* Expecte output:
161+
/* Expected output:
162162
163163
----- Nodes fullPath() -------
164164
Sequence::1

examples/t16_global_blackboard.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ int main()
9797
return 0;
9898
}
9999

100-
/* Expecte output:
100+
/* Expected output:
101101
102102
[main_print] val: 1
103103
[sub_print] val: 1

include/behaviortree_cpp/action_node.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ class SimpleActionNode : public SyncActionNode
9999
* IMPORTANT: this action is quite hard to implement correctly.
100100
* Please make sure that you know what you are doing.
101101
*
102-
* - In your overriden tick() method, you must check periodically
102+
* - In your overridden tick() method, you must check periodically
103103
* the result of the method isHaltRequested() and stop your execution accordingly.
104104
*
105-
* - in the overriden halt() method, you can do some cleanup, but do not forget to
105+
* - in the overridden halt() method, you can do some cleanup, but do not forget to
106106
* invoke the base class method ThreadedAction::halt();
107107
*
108108
* - remember, with few exceptions, a halted ThreadedAction must return NodeStatus::IDLE.

include/behaviortree_cpp/actions/pop_from_queue.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/**
2121
* Template Action used in ex04_waypoints.cpp example.
2222
*
23-
* Its purpose is to do make it easy to create while loops wich consume the elements of a queue.
23+
* Its purpose is to do make it easy to create while loops which consume the elements of a queue.
2424
*
2525
* Note that modifying the queue is not thread safe, therefore the action that creates the queue
2626
* or push elements into it, must be Synchronous.
@@ -47,7 +47,7 @@ struct ProtectedQueue
4747
*
4848
* We avoid this using reference semantic (wrapping the object in a shared_ptr).
4949
* Unfortunately, remember that this makes our access to the list not thread-safe!
50-
* This is the reason why we add a mutex to be used when modyfying the ProtectedQueue::items
50+
* This is the reason why we add a mutex to be used when modifying the ProtectedQueue::items
5151
*
5252
* */
5353

@@ -95,7 +95,7 @@ class PopFromQueue : public SyncActionNode
9595
};
9696

9797
/**
98-
* Get the size of a queue. Usefull is you want to write something like:
98+
* Get the size of a queue. Useful when you want to write something like:
9999
*
100100
* <QueueSize queue="{waypoints}" size="{wp_size}" />
101101
* <Repeat num_cycles="{wp_size}" >

include/behaviortree_cpp/actions/set_blackboard_node.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class SetBlackboardNode : public SyncActionNode
4444

4545
static PortsList providedPorts()
4646
{
47-
return { InputPort("value", "Value to be written int othe output_key"),
47+
return { InputPort("value", "Value to be written into the output_key"),
4848
BidirectionalPort("output_key", "Name of the blackboard entry where the "
4949
"value should be written") };
5050
}

include/behaviortree_cpp/actions/test_node.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct TestNodeConfig
5050
* 3. Either complete immediately (synchronous action), or after a
5151
* given period of time (asynchronous action)
5252
*
53-
* This behavior is changed by the parameters pased with TestNodeConfig.
53+
* This behavior is changed by the parameters passed with TestNodeConfig.
5454
*
5555
* This particular node is created by the factory when TestNodeConfig is
5656
* added as a substitution rule:

include/behaviortree_cpp/bt_factory.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ class BehaviorTreeFactory
475475
/**
476476
* @brief addSubstitutionRule replace a node with another one when the tree is
477477
* created.
478-
* If the rule ia a string, we will use a diferent node type (already registered)
478+
* If the rule ia a string, we will use a different node type (already registered)
479479
* instead.
480480
* If the rule is a TestNodeConfig, a test node with that configuration will be created instead.
481481
*
@@ -526,7 +526,7 @@ std::vector<Blackboard::Ptr> BlackboardBackup(const BT::Tree& tree);
526526
* @brief BlackboardRestore uses Blackboard::cloneInto to restore
527527
* all the blackboards of the tree
528528
*
529-
* @param backup a vectror of blackboards
529+
* @param backup a vector of blackboards
530530
* @param tree the destination
531531
*/
532532
void BlackboardRestore(const std::vector<Blackboard::Ptr>& backup, BT::Tree& tree);

include/behaviortree_cpp/decorators/run_once_node.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class RunOnceNode : public DecoratorNode
4242
{
4343
return { InputPort<bool>("then_skip", true,
4444
"If true, skip after the first execution, "
45-
"otherwise return the same NodeStatus returned once bu the "
45+
"otherwise return the same NodeStatus returned once by the "
4646
"child.") };
4747
}
4848

include/behaviortree_cpp/flatbuffers/bt_flatbuffer_helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ inline void CreateFlatbuffersBehaviorTree(flatbuffers::FlatBufferBuilder& builde
136136
builder.Finish(behavior_tree);
137137
}
138138

139-
/** Serialize manually the informations about state transition
139+
/** Serialize manually the information about state transition
140140
* No flatbuffer serialization here
141141
*/
142142
inline SerializedTransition SerializeTransition(uint16_t UID, Duration timestamp,

include/behaviortree_cpp/json_export.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,25 +87,25 @@ class JsonExporter
8787
/**
8888
* @brief Register new JSON converters with addConverter<Foo>().
8989
* You should used first the macro BT_JSON_CONVERTER.
90-
* The convertions from/to vector<T> are automatically registered.
90+
* The conversions from/to vector<T> are automatically registered.
9191
*/
9292
template <typename T>
9393
void addConverter();
9494

9595
/**
9696
* @brief addConverter register a to_json function that converts a json to a type T.
97-
* The convertion to std:vector<T> is automatically registered.
97+
* The conversion to std:vector<T> is automatically registered.
9898
*
9999
* @param to_json the function with signature void(const T&, nlohmann::json&)
100-
* @param add_type if true, add a field called [__type] with the name ofthe type.
100+
* @param add_type if true, add a field called [__type] with the name of the type.
101101
*/
102102
template <typename T>
103103
void addConverter(std::function<void(const T&, nlohmann::json&)> to_json,
104104
bool add_type = true);
105105

106106
/**
107107
* @brief addConverter register a from_json function that converts a json to a type T.
108-
* The convertions from std::vector<T> is automatically registered.
108+
* The conversions from std::vector<T> is automatically registered.
109109
*
110110
* @param from_json the function with signature void(const nlohmann::json&, T&)
111111
*/

include/behaviortree_cpp/loggers/groot2_protocol.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ namespace BT::Monitor
2727

2828
enum RequestType : uint8_t
2929
{
30-
// Request the entire tree defintion as XML
30+
// Request the entire tree definition as XML
3131
FULLTREE = 'T',
32-
// Request the staus of all the nodes
32+
// Request the status of all the nodes
3333
STATUS = 'S',
34-
// retrieve the valus in a set of blackboards
34+
// retrieve the values in a set of blackboards
3535
BLACKBOARD = 'B',
3636

3737
// Groot requests the insertion of a hook

include/behaviortree_cpp/scripting/operators.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ using SimpleString = SafeAny::SimpleString;
2727

2828
using expr_ptr = std::shared_ptr<struct ExprBase>;
2929

30-
// extended strin to number that consider enums and booleans
30+
// extended string to number that consider enums and booleans
3131
inline double StringToDouble(const Any& value, const Environment& env)
3232
{
3333
const auto str = value.cast<std::string>();

include/behaviortree_cpp/tree_node.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ struct NodeConfig
9999

100100
const TreeNodeManifest* manifest = nullptr;
101101

102-
// Numberic unique identifier
102+
// Numeric unique identifier
103103
uint16_t uid = 0;
104104
// Unique human-readable name, that encapsulate the subtree
105105
// hierarchy, for instance, given 2 nested trees, it should be:
@@ -209,7 +209,7 @@ class TreeNode
209209
* NodeStatus myCallback(TreeNode& node, NodeStatus status)
210210
*
211211
* This callback is executed AFTER the tick() and, if it returns SUCCESS or FAILURE,
212-
* the value returned by the actual tick() is overriden with this one.
212+
* the value returned by the actual tick() is overridden with this one.
213213
*/
214214
void setPostTickFunction(PostTickCallback callback);
215215

@@ -251,7 +251,7 @@ class TreeNode
251251

252252
/**
253253
* @brief getInputStamped is similar to getInput(dey, destination),
254-
* but it returne also the Timestamp object, that can be used to check if
254+
* but it returns also the Timestamp object, that can be used to check if
255255
* a value was updated and when.
256256
*
257257
* @param key the name of the port.
@@ -298,7 +298,7 @@ class TreeNode
298298
* @brief setOutput modifies the content of an Output port
299299
* @param key the name of the port.
300300
* @param value new value
301-
* @return valid Result, if succesful.
301+
* @return valid Result, if successful.
302302
*/
303303
template <typename T>
304304
Result setOutput(const std::string& key, const T& value);

include/behaviortree_cpp/utils/safe_any.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ inline nonstd::expected<T, std::string> Any::tryCast() const
494494
}
495495

496496
// special case when the output is an enum.
497-
// We will try first a int convertion
497+
// We will try first a int conversion
498498
if constexpr(std::is_enum_v<T>)
499499
{
500500
if(isNumber())

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[tool.codespell]
2+
ignore-words = ".codespell_ignore_words"

src/blackboard.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ void Blackboard::cloneInto(Blackboard& dst) const
176176
auto it = dst_storage.find(src_key);
177177
if(it != dst_storage.end())
178178
{
179-
// overwite
179+
// overwrite
180180
auto& dst_entry = it->second;
181181
dst_entry->string_converter = src_entry->string_converter;
182182
dst_entry->value = src_entry->value;

src/controls/fallback_node.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ NodeStatus FallbackNode::tick()
5555
case NodeStatus::FAILURE: {
5656
current_child_idx_++;
5757
// Return the execution flow if the child is async,
58-
// to make this interruptable.
58+
// to make this interruptible.
5959
if(asynch_ && requiresWakeUp() && prev_status == NodeStatus::IDLE &&
6060
current_child_idx_ < children_count)
6161
{

src/controls/sequence_node.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ NodeStatus SequenceNode::tick()
6262
case NodeStatus::SUCCESS: {
6363
current_child_idx_++;
6464
// Return the execution flow if the child is async,
65-
// to make this interruptable.
65+
// to make this interruptible.
6666
if(asynch_ && requiresWakeUp() && prev_status == NodeStatus::IDLE &&
6767
current_child_idx_ < children_count)
6868
{

src/controls/sequence_with_memory_node.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ NodeStatus SequenceWithMemory::tick()
5555
case NodeStatus::SUCCESS: {
5656
current_child_idx_++;
5757
// Return the execution flow if the child is async,
58-
// to make this interruptable.
58+
// to make this interruptible.
5959
if(requiresWakeUp() && prev_status == NodeStatus::IDLE &&
6060
current_child_idx_ < children_count)
6161
{

src/decorators/repeat_node.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ NodeStatus RepeatNode::tick()
5959
resetChild();
6060

6161
// Return the execution flow if the child is async,
62-
// to make this interruptable.
62+
// to make this interruptible.
6363
if(requiresWakeUp() && prev_status == NodeStatus::IDLE && do_loop)
6464
{
6565
emitWakeUpSignal();

src/decorators/retry_node.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ NodeStatus RetryNode::tick()
7474
resetChild();
7575

7676
// Return the execution flow if the child is async,
77-
// to make this interruptable.
77+
// to make this interruptible.
7878
if(requiresWakeUp() && prev_status == NodeStatus::IDLE && do_loop)
7979
{
8080
emitWakeUpSignal();

0 commit comments

Comments
 (0)