Skip to content

Added codespell as a pre-commit hook. #977

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

Merged
merged 1 commit into from
May 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .codespell_ignore_words
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
INOUT
InOut
delimeter
Succesful
worl
valu
Exeption
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,13 @@ repos:
hooks:
- id: clang-format
args: ['-fallback-style=none', '-i']

# Spell check
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
additional_dependencies:
- tomli
args:
[--toml=./pyproject.toml]
16 changes: 8 additions & 8 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Changelog for package behaviortree_cpp
* Fix dangling‐capture in TestNodeConfig
* Fix Precondition to only check condition once (`#904 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/904>`_)
* fix issue 945
* extend JSON convertion to include vectors (`#965 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/965>`_)
* extend JSON conversion to include vectors (`#965 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/965>`_)
* Fix CI, add BUILD_TESTS and remove catkin support
* Fix testing CMake issue to resolve Rolling regression (`#961 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/961>`_)
* Bug fix/set blackboard (`#955 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/955>`_)
Expand Down Expand Up @@ -116,7 +116,7 @@ Changelog for package behaviortree_cpp
* warn about overwritten enums
* fix ambiguous to_json
* Extend unit test for blackboard backup to run the second tree (`#789 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/789>`_)
* json convertion changed and
* json conversion changed and
* 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>`_)
* Update switch_node.h
* test moved and port remapping fixed
Expand Down Expand Up @@ -393,7 +393,7 @@ Changelog for package behaviortree_cpp
* better include paths
* Control node and Decorators RUNNING before first child
* blackboard: update getKeys and add mutex to scripting
* add [[nodiscard]] and some othe minor changes
* add [[nodiscard]] and some other minor changes
* add screenshot
* change the behavior of tickOnce to actually loop is wake up signal is… (`#522 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/522>`_)
* change the behavior of tickOnce to actually loop is wake up signal is received
Expand Down Expand Up @@ -492,7 +492,7 @@ Changelog for package behaviortree_cpp
dependency explicitly.
* Change order of lock to prevent deadlock. (`#368 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/368>`_)
Resolves `#367 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/367>`_.
* Fix `#320 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/320>`_ : forbit refrences in Any
* Fix `#320 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/320>`_ : forbid references in Any
* Update action_node.h
* Contributors: Adam Sasine, Davide Faconti, Fabian Schurig, Griswald Brooks, Hyeongsik Min, Robodrome, imgbot[bot], panwauu

Expand Down Expand Up @@ -839,9 +839,9 @@ Changelog for package behaviortree_cpp
* Conan package distribution (#39)
* Non-functional refactoring of xml_parsing to clean up the code
* cosmetic changes in the code of BehaviorTreeFactory
* XML schema. Related to enchancement #40
* XML schema. Related to enhancement #40
* call setRegistrationName() for built-in Nodes
The methos is called by BehaviorTreefactory, therefore it
The method is called by BehaviorTreefactory, therefore it
registrationName is empty if trees are created programmatically.
* Reset reference count when destroying logger (issue #38)
* Contributors: Davide Facont, Davide Faconti, Uilian Ries
Expand All @@ -857,7 +857,7 @@ Changelog for package behaviortree_cpp
------------------
* adding virtual TreeNode::onInit() [issue #33]
* fix issue #34 : if you don't implement convertFromString, it will compile but it may throw
* Pretty demangled names and obsolate comments removed
* Pretty demangled names and obsolete comments removed
* bug fixes
* more comments
* [enhancement #32]: add CoroActionNode and rename ActionNode as "AsynActionNode"
Expand Down Expand Up @@ -924,7 +924,7 @@ Changelog for package behaviortree_cpp
* Fix: registerBuilder did not register the manifest. It was "broken" as public API method
* Use the Pimpl idiom to hide zmq from the header file
* move header of minitrace in the cpp file
* Fixed a crash occuring when you didn't initialized a Tree object (#20)
* Fixed a crash occurring when you didn't initialized a Tree object (#20)
* Fix issue #16
* add ParallelNode to pre-registered entries in factory (issue #13)
* removed M_PI
Expand Down
4 changes: 2 additions & 2 deletions cmake/conan.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ macro(_conan_check_language)
set(LANGUAGE C)
set(USING_CXX 0)
else ()
message(FATAL_ERROR "Conan: Neither C or C++ was detected as a language for the project. Unabled to detect compiler version.")
message(FATAL_ERROR "Conan: Neither C or C++ was detected as a language for the project. Unable to detect compiler version.")
endif()
endmacro()

Expand Down Expand Up @@ -1050,7 +1050,7 @@ macro(conan_config_install)
endif()

if(DEFINED CONAN_ARGS)
# Convert ; seperated multi arg list into space seperated string
# Convert ; separated multi arg list into space separated string
string(REPLACE ";" " " l_CONAN_ARGS "${CONAN_ARGS}")
set(CONAN_ARGS_ARGS "--args=${l_CONAN_ARGS}")
endif()
Expand Down
2 changes: 1 addition & 1 deletion examples/t12_default_ports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct Point2D
}
};

// Allow bi-directional convertion to JSON
// Allow bi-directional conversion to JSON
BT_JSON_CONVERTER(Point2D, point)
{
add_field("x", &point.x);
Expand Down
4 changes: 2 additions & 2 deletions examples/t15_nodes_mocking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ int main(int argc, char** argv)
factory.loadSubstitutionRuleFromJSON(json_text);
}
//---------------------------------------------------------------
// IMPORTANT: all substiutions must be done BEFORE creating the tree
// IMPORTANT: all substitutions must be done BEFORE creating the tree
// During the construction phase of the tree, the substitution
// rules will be used to instantiate the test nodes, instead of the
// original ones.
Expand All @@ -158,7 +158,7 @@ int main(int argc, char** argv)
return 0;
}

/* Expecte output:
/* Expected output:

----- Nodes fullPath() -------
Sequence::1
Expand Down
2 changes: 1 addition & 1 deletion examples/t16_global_blackboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ int main()
return 0;
}

/* Expecte output:
/* Expected output:

[main_print] val: 1
[sub_print] val: 1
Expand Down
4 changes: 2 additions & 2 deletions include/behaviortree_cpp/action_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ class SimpleActionNode : public SyncActionNode
* IMPORTANT: this action is quite hard to implement correctly.
* Please make sure that you know what you are doing.
*
* - In your overriden tick() method, you must check periodically
* - In your overridden tick() method, you must check periodically
* the result of the method isHaltRequested() and stop your execution accordingly.
*
* - in the overriden halt() method, you can do some cleanup, but do not forget to
* - in the overridden halt() method, you can do some cleanup, but do not forget to
* invoke the base class method ThreadedAction::halt();
*
* - remember, with few exceptions, a halted ThreadedAction must return NodeStatus::IDLE.
Expand Down
6 changes: 3 additions & 3 deletions include/behaviortree_cpp/actions/pop_from_queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* Template Action used in ex04_waypoints.cpp example.
*
* Its purpose is to do make it easy to create while loops wich consume the elements of a queue.
* Its purpose is to do make it easy to create while loops which consume the elements of a queue.
*
* Note that modifying the queue is not thread safe, therefore the action that creates the queue
* or push elements into it, must be Synchronous.
Expand All @@ -47,7 +47,7 @@ struct ProtectedQueue
*
* We avoid this using reference semantic (wrapping the object in a shared_ptr).
* Unfortunately, remember that this makes our access to the list not thread-safe!
* This is the reason why we add a mutex to be used when modyfying the ProtectedQueue::items
* This is the reason why we add a mutex to be used when modifying the ProtectedQueue::items
*
* */

Expand Down Expand Up @@ -95,7 +95,7 @@ class PopFromQueue : public SyncActionNode
};

/**
* Get the size of a queue. Usefull is you want to write something like:
* Get the size of a queue. Useful when you want to write something like:
*
* <QueueSize queue="{waypoints}" size="{wp_size}" />
* <Repeat num_cycles="{wp_size}" >
Expand Down
2 changes: 1 addition & 1 deletion include/behaviortree_cpp/actions/set_blackboard_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SetBlackboardNode : public SyncActionNode

static PortsList providedPorts()
{
return { InputPort("value", "Value to be written int othe output_key"),
return { InputPort("value", "Value to be written into the output_key"),
BidirectionalPort("output_key", "Name of the blackboard entry where the "
"value should be written") };
}
Expand Down
2 changes: 1 addition & 1 deletion include/behaviortree_cpp/actions/test_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct TestNodeConfig
* 3. Either complete immediately (synchronous action), or after a
* given period of time (asynchronous action)
*
* This behavior is changed by the parameters pased with TestNodeConfig.
* This behavior is changed by the parameters passed with TestNodeConfig.
*
* This particular node is created by the factory when TestNodeConfig is
* added as a substitution rule:
Expand Down
4 changes: 2 additions & 2 deletions include/behaviortree_cpp/bt_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ class BehaviorTreeFactory
/**
* @brief addSubstitutionRule replace a node with another one when the tree is
* created.
* If the rule ia a string, we will use a diferent node type (already registered)
* If the rule ia a string, we will use a different node type (already registered)
* instead.
* If the rule is a TestNodeConfig, a test node with that configuration will be created instead.
*
Expand Down Expand Up @@ -526,7 +526,7 @@ std::vector<Blackboard::Ptr> BlackboardBackup(const BT::Tree& tree);
* @brief BlackboardRestore uses Blackboard::cloneInto to restore
* all the blackboards of the tree
*
* @param backup a vectror of blackboards
* @param backup a vector of blackboards
* @param tree the destination
*/
void BlackboardRestore(const std::vector<Blackboard::Ptr>& backup, BT::Tree& tree);
Expand Down
2 changes: 1 addition & 1 deletion include/behaviortree_cpp/decorators/run_once_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class RunOnceNode : public DecoratorNode
{
return { InputPort<bool>("then_skip", true,
"If true, skip after the first execution, "
"otherwise return the same NodeStatus returned once bu the "
"otherwise return the same NodeStatus returned once by the "
"child.") };
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ inline void CreateFlatbuffersBehaviorTree(flatbuffers::FlatBufferBuilder& builde
builder.Finish(behavior_tree);
}

/** Serialize manually the informations about state transition
/** Serialize manually the information about state transition
* No flatbuffer serialization here
*/
inline SerializedTransition SerializeTransition(uint16_t UID, Duration timestamp,
Expand Down
8 changes: 4 additions & 4 deletions include/behaviortree_cpp/json_export.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,25 +83,25 @@ class JsonExporter
/**
* @brief Register new JSON converters with addConverter<Foo>().
* You should used first the macro BT_JSON_CONVERTER.
* The convertions from/to vector<T> are automatically registered.
* The conversions from/to vector<T> are automatically registered.
*/
template <typename T>
void addConverter();

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

/**
* @brief addConverter register a from_json function that converts a json to a type T.
* The convertions from std::vector<T> is automatically registered.
* The conversions from std::vector<T> is automatically registered.
*
* @param from_json the function with signature void(const nlohmann::json&, T&)
*/
Expand Down
6 changes: 3 additions & 3 deletions include/behaviortree_cpp/loggers/groot2_protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ namespace BT::Monitor

enum RequestType : uint8_t
{
// Request the entire tree defintion as XML
// Request the entire tree definition as XML
FULLTREE = 'T',
// Request the staus of all the nodes
// Request the status of all the nodes
STATUS = 'S',
// retrieve the valus in a set of blackboards
// retrieve the values in a set of blackboards
BLACKBOARD = 'B',

// Groot requests the insertion of a hook
Expand Down
2 changes: 1 addition & 1 deletion include/behaviortree_cpp/scripting/operators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using SimpleString = SafeAny::SimpleString;

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

// extended strin to number that consider enums and booleans
// extended string to number that consider enums and booleans
inline double StringToDouble(const Any& value, const Environment& env)
{
const auto str = value.cast<std::string>();
Expand Down
8 changes: 4 additions & 4 deletions include/behaviortree_cpp/tree_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ struct NodeConfig

const TreeNodeManifest* manifest = nullptr;

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

Expand Down Expand Up @@ -251,7 +251,7 @@ class TreeNode

/**
* @brief getInputStamped is similar to getInput(dey, destination),
* but it returne also the Timestamp object, that can be used to check if
* but it returns also the Timestamp object, that can be used to check if
* a value was updated and when.
*
* @param key the name of the port.
Expand Down Expand Up @@ -298,7 +298,7 @@ class TreeNode
* @brief setOutput modifies the content of an Output port
* @param key the name of the port.
* @param value new value
* @return valid Result, if succesful.
* @return valid Result, if successful.
*/
template <typename T>
Result setOutput(const std::string& key, const T& value);
Expand Down
2 changes: 1 addition & 1 deletion include/behaviortree_cpp/utils/safe_any.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ inline nonstd::expected<T, std::string> Any::tryCast() const
}

// special case when the output is an enum.
// We will try first a int convertion
// We will try first a int conversion
if constexpr(std::is_enum_v<T>)
{
if(isNumber())
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tool.codespell]
ignore-words = ".codespell_ignore_words"
2 changes: 1 addition & 1 deletion src/blackboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void Blackboard::cloneInto(Blackboard& dst) const
auto it = dst_storage.find(src_key);
if(it != dst_storage.end())
{
// overwite
// overwrite
auto& dst_entry = it->second;
dst_entry->string_converter = src_entry->string_converter;
dst_entry->value = src_entry->value;
Expand Down
2 changes: 1 addition & 1 deletion src/controls/fallback_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ NodeStatus FallbackNode::tick()
case NodeStatus::FAILURE: {
current_child_idx_++;
// Return the execution flow if the child is async,
// to make this interruptable.
// to make this interruptible.
if(asynch_ && requiresWakeUp() && prev_status == NodeStatus::IDLE &&
current_child_idx_ < children_count)
{
Expand Down
2 changes: 1 addition & 1 deletion src/controls/sequence_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ NodeStatus SequenceNode::tick()
case NodeStatus::SUCCESS: {
current_child_idx_++;
// Return the execution flow if the child is async,
// to make this interruptable.
// to make this interruptible.
if(asynch_ && requiresWakeUp() && prev_status == NodeStatus::IDLE &&
current_child_idx_ < children_count)
{
Expand Down
2 changes: 1 addition & 1 deletion src/controls/sequence_with_memory_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ NodeStatus SequenceWithMemory::tick()
case NodeStatus::SUCCESS: {
current_child_idx_++;
// Return the execution flow if the child is async,
// to make this interruptable.
// to make this interruptible.
if(requiresWakeUp() && prev_status == NodeStatus::IDLE &&
current_child_idx_ < children_count)
{
Expand Down
2 changes: 1 addition & 1 deletion src/decorators/repeat_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ NodeStatus RepeatNode::tick()
resetChild();

// Return the execution flow if the child is async,
// to make this interruptable.
// to make this interruptible.
if(requiresWakeUp() && prev_status == NodeStatus::IDLE && do_loop)
{
emitWakeUpSignal();
Expand Down
2 changes: 1 addition & 1 deletion src/decorators/retry_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ NodeStatus RetryNode::tick()
resetChild();

// Return the execution flow if the child is async,
// to make this interruptable.
// to make this interruptible.
if(requiresWakeUp() && prev_status == NodeStatus::IDLE && do_loop)
{
emitWakeUpSignal();
Expand Down
Loading
Loading