diff --git a/.codespellexclude b/.codespellexclude new file mode 100644 index 000000000..2de0f331f --- /dev/null +++ b/.codespellexclude @@ -0,0 +1,15 @@ + v8->setName("neether"); + " \n" + ths + ths + + auto ue = std::any_cast(expectedItems[id][index].second); +* Fixed typos: occurence -> occurRence by `@agarny `_ [`#794 `_]. + std::vector mErrors; + mErrors.push_back(index); + mErrors.erase(mErrors.begin() + ptrdiff_t(index)); + mIssues.erase(mIssues.begin() + ptrdiff_t(mErrors.at(index))); + mErrors.clear(); + if (index < pFunc()->mErrors.size()) { + issue = pFunc()->mIssues.at(pFunc()->mErrors.at(index)); + return pFunc()->mErrors.size(); diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml new file mode 100644 index 000000000..458afd997 --- /dev/null +++ b/.github/workflows/spell-check.yml @@ -0,0 +1,21 @@ +# GitHub Action to automate the identification of common misspellings in text files. +# https://github.com/codespell-project/actions-codespell +# https://github.com/codespell-project/codespell +name: codespell +on: [pull_request] + +permissions: + contents: read + +jobs: + codespell: + if: github.repository == 'cellml/libcellml' + name: Check for spelling errors + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: codespell-project/actions-codespell@v2 + with: + check_filenames: true + skip: ./.git,./tests/gtest/include/gtest/gtest.h,./tests/gtest/src/gtest-all.cc,./src/dtds/mathml2/* + exclude_file: .codespellexclude diff --git a/docs/configure_and_build.rst b/docs/configure_and_build.rst index 36fa54743..79af3b24f 100644 --- a/docs/configure_and_build.rst +++ b/docs/configure_and_build.rst @@ -147,7 +147,7 @@ Policy CMP0086 is not set ------------------------- Despite being in red and repeated multiple times, this is a warning which can safely be ignored. -It's caused by a version mis-match between SWIG and libCellML and will be addressed in the next release. +It's caused by a version mismatch between SWIG and libCellML and will be addressed in the next release. .. figure:: ./images/libCellMLBuilding-PolicyCMP0086Error.png :align: center @@ -223,7 +223,7 @@ Once you have used CMake to configure and generate your project files, either pu Fatal error: Cannot open include file Python.h ++++++++++++++++++++++++++++++++++++++++++++++ -If you've included Python bindings in your CMake configuration, but get this error in Visual Studio at build time, it's because the path to the Python installation was not set correctly in the CMake step. Re-running the CMake configuration with a manually-specified path to the Python installation will solve the problem. See `ERROR: On Windows without Python debug libaries` for instructions. +If you've included Python bindings in your CMake configuration, but get this error in Visual Studio at build time, it's because the path to the Python installation was not set correctly in the CMake step. Re-running the CMake configuration with a manually-specified path to the Python installation will solve the problem. See `ERROR: On Windows without Python debug libraries` for instructions. Cannot access xxx +++++++++++++++++ diff --git a/docs/dev_utilities.rst b/docs/dev_utilities.rst index 5030a77c3..7f8dfa7bd 100644 --- a/docs/dev_utilities.rst +++ b/docs/dev_utilities.rst @@ -2,7 +2,7 @@ Utilities ========= -This document covers the utilities that are availble to developers of libCellML. +This document covers the utilities that are available to developers of libCellML. The utilities are not built or made available by default. The utilities can be enabled through the configuration of the library. In order to enable the utilities, set the configuration variable :code:`LIBCELLML_ENABLE_UTILITIES` to :code:`TRUE`. @@ -18,7 +18,7 @@ Create MathML DTD files The create MathML DTD files utility generates a compressed MathML DTD. The MathML DTD is used to determine the validity of MathML strings in a CellML document. This utility updates the header file :code:`mathmldtd.h` and source file :code:`mathmldtd.cpp` in the source tree of the current build. -For a make-based envirionment, the utility may be run with the following command:: +For a make-based environment, the utility may be run with the following command:: make create_mathml_dtd_files @@ -27,6 +27,6 @@ Update generator profile SHA-1 values The update generator profile SHA-1 values utility calculates the SHA-1 values for the current C and Python generator profiles. This utility updates the header file :code:`generatorprofilesha1values.h` in the source tree of the current build. -For a make-based envirionment, the utility may be run with the following command:: +For a make-based environment, the utility may be run with the following command:: make update_generator_profile_sha1_values diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2129b330e..30a60d5bc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -201,7 +201,7 @@ else() target_compile_definitions(cellml PUBLIC ${LIBXML2_DEFINITIONS}) endif() -# Use target compile features to propogate features to consuming projects. +# Use target compile features to propagate features to consuming projects. target_compile_features(cellml PUBLIC cxx_std_17) set_target_properties(cellml PROPERTIES diff --git a/src/analyser.cpp b/src/analyser.cpp index 40a13f0fe..9d3302531 100644 --- a/src/analyser.cpp +++ b/src/analyser.cpp @@ -478,7 +478,7 @@ bool AnalyserInternalEquation::check(const AnalyserModelPtr &model, // An ODE equation may have a dependency on the state of that ODE (e.g., // dx/dt = x+3). Similarly, an NLA equation will have a "dependency" on - // its unknown variables. Either way, we must remove our "depenencies" + // its unknown variables. Either way, we must remove our "dependencies" // on our unknown variables or we will end up in a circular dependency. for (const auto &unknownVariable : mUnknownVariables) { diff --git a/src/api/libcellml/importsource.h b/src/api/libcellml/importsource.h index 94403902e..16fdb9f84 100644 --- a/src/api/libcellml/importsource.h +++ b/src/api/libcellml/importsource.h @@ -63,7 +63,7 @@ class LIBCELLML_EXPORT ImportSource: public Entity * Get the source @ref Model's URL set in this instance. If no source @ref Model * URL is set then return an empty string. * - * @return The URL of the source @ref Model if set otherwise the emtpy string. + * @return The URL of the source @ref Model if set otherwise the empty string. */ std::string url() const; diff --git a/src/api/libcellml/model.h b/src/api/libcellml/model.h index 311e96190..afd0e3a43 100644 --- a/src/api/libcellml/model.h +++ b/src/api/libcellml/model.h @@ -356,7 +356,7 @@ class LIBCELLML_EXPORT Model: public ComponentEntity /** * @brief Remove any empty components and units from the model. * - * Remove any empty components and units fom this model. + * Remove any empty components and units from this model. * In this context, "empty" means: * - components with no name, identifier, resets, variables, maths, or non-empty child components; and * - units which have no name, identifier, or child units. diff --git a/src/bindings/interface/createconstructor.i b/src/bindings/interface/createconstructor.i index 93a4fc2ea..9ea658941 100644 --- a/src/bindings/interface/createconstructor.i +++ b/src/bindings/interface/createconstructor.i @@ -1,6 +1,6 @@ // This is a helper macro for extending the bindings to have a Constructor mapped to the static create method. -// The macro create_name_constructor must be used in conjuction with the create_constructor macro. +// The macro create_name_constructor must be used in conjunction with the create_constructor macro. %define %create_constructor(TYPE...) %typemap(out) libcellml::TYPE *TYPE() { diff --git a/src/bindings/python/CMakeLists.txt b/src/bindings/python/CMakeLists.txt index 74d0917c4..c98abd754 100644 --- a/src/bindings/python/CMakeLists.txt +++ b/src/bindings/python/CMakeLists.txt @@ -106,7 +106,7 @@ foreach(SWIG_INTERFACE_SRC ${SWIG_INTERFACE_SRCS}) endif() if (APPLE) - # Specifically allow dynamic lookup, here we are really targetting Python symbols. + # Specifically allow dynamic lookup, here we are really targeting Python symbols. set_target_properties(${MODULE_TARGET} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") # But, we do need to know about the Python include directories. target_include_directories(${MODULE_TARGET} PRIVATE ${Python_INCLUDE_DIRS}) diff --git a/src/internaltypes.h b/src/internaltypes.h index a415f27ce..535fea5d3 100644 --- a/src/internaltypes.h +++ b/src/internaltypes.h @@ -31,7 +31,7 @@ const std::string ORIGIN_MODEL_REF = ":this:"; using ComponentNameMap = std::map; /**< Type definition for map of component name to component pointer. */ -using IndexStack = std::vector; /**< Type definition for tracking indicies. */ +using IndexStack = std::vector; /**< Type definition for tracking indices. */ using EquivalenceMap = std::map>; /**< Type definition for map of variable equivalences defined over model. */ using NameList = std::vector; /**< Type definition for list of names. */ diff --git a/src/parser.cpp b/src/parser.cpp index 679a62278..7c355b209 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -115,7 +115,7 @@ class Parser::ParserImpl: public Logger::LoggerImpl /** * @brief Recursively update the @p model with the encapsulation parsed from the @p node. * - * Recusively parse through the @p node to create the component hierarchy. Returns the + * Recursively parse through the @p node to create the component hierarchy. Returns the * root component of the hierarchy to the calling method. * * @param model The @c ModelPtr to update. @@ -294,7 +294,7 @@ ModelPtr Parser::ParserImpl::parseModel(const std::string &input) * @brief Test to determine if the attribute is an XML identifier. * * Test to determine if the attribute is an XML identifier. When - * transfoming from CellML 1.0 and CellML 1.1 it will also test for + * transforming from CellML 1.0 and CellML 1.1 it will also test for * XML identifiers in the CMETA 1.0 namespace. * * @param attribute The attribute to test. diff --git a/src/utilities.h b/src/utilities.h index 74516691b..cf3830c81 100644 --- a/src/utilities.h +++ b/src/utilities.h @@ -176,7 +176,7 @@ bool canConvertToBasicDouble(const std::string &in); * @sa isCellMLReal * * @param in The @c std::string value to convert to a @c double. - * @param out The value of the @p in as a doulbe if the conversion was successful, + * @param out The value of the @p in as a double if the conversion was successful, * left unchanged if the conversion fails. * * @return @c true if the conversion succeeded, @c false otherwise. @@ -710,7 +710,7 @@ std::vector equivalentVariables(const VariablePtr &variable); * @param owner The owner to compare entities with. * @param entities The list of entities to equate. * - * @return @c true if all the entities in @p entities are equal to entites in the @p owner. + * @return @c true if all the entities in @p entities are equal to entities in the @p owner. */ bool equalEntities(const EntityPtr &owner, const std::vector &entities); diff --git a/src/validator.cpp b/src/validator.cpp index 47c9dd65c..507344ece 100644 --- a/src/validator.cpp +++ b/src/validator.cpp @@ -327,7 +327,7 @@ class Validator::ValidatorImpl: public LoggerImpl /** * @brief Validate the component tree of the given @p component. * - * Validate the given compoment and all child components of the component. + * Validate the given component and all child components of the component. * * @param model The model the @p component comes from. * @param component The @c Component to validate. @@ -711,7 +711,7 @@ ValidatorPtr Validator::create() noexcept void Validator::validateModel(const ModelPtr &model) { - // Clear any pre-existing issues in ths validator instance. + // Clear any pre-existing issues in this validator instance. pFunc()->removeAllIssues(); if (model == nullptr) { diff --git a/src/variable.cpp b/src/variable.cpp index 66c1dcee8..e23408d65 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -206,7 +206,7 @@ bool Variable::VariableImpl::hasEquivalentVariable(const VariablePtr &equivalent * * @param variable1 The first variable to test. * @param variable2 The second variable to test. - * @param testedVariables Vector of previoulsy tested variables. + * @param testedVariables Vector of previously tested variables. * * @return True if the two given variables are equivalent, false otherwise. */ diff --git a/src/xmlnode.h b/src/xmlnode.h index 1cfcae3f7..0d34b1e16 100644 --- a/src/xmlnode.h +++ b/src/xmlnode.h @@ -320,7 +320,7 @@ class XmlNode * * Set the attribute of the given @p attributeName to the given @p attributeValue. * The attribute name must already exist. - * If the attribute name does not already exist the attibute value will not be modified. + * If the attribute name does not already exist the attribute value will not be modified. * * @param attributeName The @c char attribute type. * @param attributeValue The @c char value of the attribute to set. diff --git a/tests/resources/cellml1X/Hodgkin_Huxley_1952_modified.cellml b/tests/resources/cellml1X/Hodgkin_Huxley_1952_modified.cellml index 50646f0e4..1681ef6b4 100644 --- a/tests/resources/cellml1X/Hodgkin_Huxley_1952_modified.cellml +++ b/tests/resources/cellml1X/Hodgkin_Huxley_1952_modified.cellml @@ -767,7 +767,7 @@ http://www.CellML.org/ - Added stimulus protocol to allow simulation of trains of action potentials. The stimulus amplitude (20 microamperes per cm2) and duration (0.5 ms) were taken from the single stimulus in the previous version. Set a period of 200 ms (arbitrary) to allow visualisation of 3 action potentials together at a resonable zoom level. + Added stimulus protocol to allow simulation of trains of action potentials. The stimulus amplitude (20 microamperes per cm2) and duration (0.5 ms) were taken from the single stimulus in the previous version. Set a period of 200 ms (arbitrary) to allow visualisation of 3 action potentials together at a reasonable zoom level. diff --git a/tests/resources/invalidmathmlelementschildrenorsiblings.cellml b/tests/resources/invalidmathmlelementschildrenorsiblings.cellml index 991cb71da..7e931dcf2 100644 --- a/tests/resources/invalidmathmlelementschildrenorsiblings.cellml +++ b/tests/resources/invalidmathmlelementschildrenorsiblings.cellml @@ -221,7 +221,7 @@ b - + a b @@ -281,7 +281,7 @@ b - + a b @@ -325,7 +325,7 @@ b - + a b diff --git a/tests/test_utils.h b/tests/test_utils.h index 041910670..b446ac238 100644 --- a/tests/test_utils.h +++ b/tests/test_utils.h @@ -126,5 +126,5 @@ void TEST_EXPORT compareModel(const libcellml::ModelPtr &m1, const libcellml::Mo expectEqualIssuesSpecificationHeadingsUrls(issues, specificationHeadings, urls, logger) #define EXPECT_EQ_ISSUES_CELLMLELEMENTTYPES_LEVELS_REFERENCERULES_URLS(issues, cellmlElementTypes, levels, referenceRules, urls, logger) \ - SCOPED_TRACE("Issue occured here."); \ + SCOPED_TRACE("Issue occurred here."); \ expectEqualIssuesCellmlElementTypesLevelsReferenceRulesUrls(issues, cellmlElementTypes, levels, referenceRules, urls, logger) diff --git a/tests/units/units.cpp b/tests/units/units.cpp index c3fb6ae48..5a0855811 100644 --- a/tests/units/units.cpp +++ b/tests/units/units.cpp @@ -1722,7 +1722,7 @@ TEST(Units, compareUnitsCompatibleComplex) u2->setName("u2"); u2->addUnit(libcellml::Units::StandardUnit::AMPERE, 0, 1.0, 3.0); u2->addUnit("u"); - u2->addUnit("metre", "milli", 2.0, 1.0); // Only unit attirbutes which matter now are the exponent and the base unit. Not interested in multipliers. + u2->addUnit("metre", "milli", 2.0, 1.0); // Only unit attributes which matter now are the exponent and the base unit. Not interested in multipliers. libcellml::ModelPtr model = libcellml::Model::create(); model->setName("model");