From 7e6463c200320044467e98496eb3ea2d8ed73161 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 20 Nov 2023 17:04:33 -0800 Subject: [PATCH] codespell --- .ci-local/codespell.dic | 0 .github/workflows/codespell.yml | 30 ++++++++++++++++++++++++++++++ documentation/client.rst | 2 +- documentation/nt.rst | 2 +- documentation/ntscalar.rst | 2 +- documentation/releasenotes.rst | 2 +- documentation/server.rst | 8 ++++---- documentation/typedef.rst | 2 +- documentation/util.rst | 2 +- ioc/field.h | 2 +- ioc/iochooks.cpp | 2 +- ioc/pvalink.h | 2 +- qsrv/softMain.cpp | 2 +- src/bitmask.h | 4 ++-- src/clientget.cpp | 2 +- src/log.cpp | 6 +++--- src/pvaproto.h | 4 ++-- src/pvxs/server.h | 2 +- src/pvxs/source.h | 2 +- src/pvxs/version.h | 2 +- test/benchdata.cpp | 4 ++-- test/testpvalink.cpp | 2 +- tools/mshim.cpp | 8 ++++---- 23 files changed, 62 insertions(+), 32 deletions(-) create mode 100644 .ci-local/codespell.dic create mode 100644 .github/workflows/codespell.yml diff --git a/.ci-local/codespell.dic b/.ci-local/codespell.dic new file mode 100644 index 0000000..e69de29 diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000..bc978ba --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,30 @@ +name: Spell Check + +on: + push: + paths-ignore: + - test + - bundle + - .ci + - "**/.db" + pull_request: + paths-ignore: + - test + - bundle + - .ci + - "**/.db" + workflow_dispatch: + +jobs: + codespell: + name: Spell Check + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Apt + run: | + sudo apt-get update + sudo apt-get -y install codespell + - name: codespell + run: git ls-files | grep -vE 'test|bundle|.ci|.\db' | xargs codespell -I .ci-local/codespell.dic diff --git a/documentation/client.rst b/documentation/client.rst index b151cd2..0328320 100644 --- a/documentation/client.rst +++ b/documentation/client.rst @@ -252,7 +252,7 @@ Secondly, to provide certain well-known options to modify the operation. The pvRequest conditions may be specified in three ways through the methods of `pvxs::client::detail::CommonBuilder` exposed through the individual \*Builder types. -Programatic +Programmatic The field() and record() methods. Textual diff --git a/documentation/nt.rst b/documentation/nt.rst index ba39c2a..9cc65a4 100644 --- a/documentation/nt.rst +++ b/documentation/nt.rst @@ -69,7 +69,7 @@ alarm_t The meaning of Minor and Major are contextual and may be different for each PV. An Invalid alarm severity means that the value field should not be taken as - a meaningful represention of eg. the quantity being measured. Typically, + a meaningful representation of eg. the quantity being measured. Typically, it reflects the most recent valid value. A UI client may change the state of a widget displaying a value which is alarming diff --git a/documentation/ntscalar.rst b/documentation/ntscalar.rst index 023cd4c..5a12e31 100644 --- a/documentation/ntscalar.rst +++ b/documentation/ntscalar.rst @@ -6,7 +6,7 @@ NTScalar and NTScalarArray The ``epics:nt/NTScalar:1.0`` and related ``epics:nt/NTScalarArray:1.0`` definitions describe a primary 'value' and supporting meta-data. -In the case of NTScalarArray the value is a 1-d array of primative type. +In the case of NTScalarArray the value is a 1-d array of primitive type. In the case of NTScalar the value is a single primitive value. Both variants include time and alarm meta-data fields, diff --git a/documentation/releasenotes.rst b/documentation/releasenotes.rst index 7e86597..b67d5ce 100644 --- a/documentation/releasenotes.rst +++ b/documentation/releasenotes.rst @@ -154,7 +154,7 @@ Release Notes * PVXS now attempts to fanout unicast searches through the loopback interface, and to handle ``CMD_ORIGIN_TAG`` messages (aka. the local multicast hack). * Add `pvxs::client::Context::discover` to enumerate and track PVA Servers. -* ``pvxlist`` add "continous" mode. (eg. ``pvxlist -v -w 0``) +* ``pvxlist`` add "continuous" mode. (eg. ``pvxlist -v -w 0``) To immediately Discover new servers, then continue listening for Beacons to detect as server go up and down (like ``casw``). Also, to be gentler on your network, add ``-P`` to skip initial Discovery ping, diff --git a/documentation/server.rst b/documentation/server.rst index 5223b7e..0d89035 100644 --- a/documentation/server.rst +++ b/documentation/server.rst @@ -46,12 +46,12 @@ Entries naming multiple :ref:`environ` will prefer the left most which is set. eg. ``EPICS_PVA_ADDR_LIST`` is only checked if ``EPICS_PVAS_BEACON_ADDR_LIST`` is unset. EPICS_PVAS_INTF_ADDR_LIST - Space seperated list of local interface addresses to which the server will bind. + Space separated list of local interface addresses to which the server will bind. Port numbers are parsed and ignore. Sets `pvxs::server::Config::interfaces` EPICS_PVAS_BEACON_ADDR_LIST or EPICS_PVA_ADDR_LIST - Space seperated list of unicast or broadcast addresses. + Space separated list of unicast or broadcast addresses. This list is supplimented all local broadcast addresses if auto-beacon is YES. Sets `pvxs::server::Config::beaconDestinations` @@ -61,7 +61,7 @@ EPICS_PVAS_AUTO_BEACON_ADDR_LIST or EPICS_PVA_AUTO_ADDR_LIST EPICS_PVAS_SERVER_PORT or EPICS_PVA_SERVER_PORT Single integer. - Prefered TCP port to bind. + Preferred TCP port to bind. If already in use then a random port will be chosen. Sets `pvxs::server::Config::tcp_port` @@ -72,7 +72,7 @@ EPICS_PVAS_BROADCAST_PORT or EPICS_PVA_BROADCAST_PORT Sets `pvxs::server::Config::udp_port` EPICS_PVAS_IGNORE_ADDR_LIST - Space seperated list of addresses with optional port. + Space separated list of addresses with optional port. Port zero is treated as a wildcard to match any port. UDP traffic from matched addresses will be ignored with no further processing. diff --git a/documentation/typedef.rst b/documentation/typedef.rst index b557074..d54a410 100644 --- a/documentation/typedef.rst +++ b/documentation/typedef.rst @@ -13,7 +13,7 @@ as well as arrays of either. The `pvxs::TypeCode::code_t` enum is an exhaustive list of all valid types, as well as Null. -Any valid type may be instanciate directly. +Any valid type may be instantiate directly. .. code-block:: c++ diff --git a/documentation/util.rst b/documentation/util.rst index a4e87c7..e08175b 100644 --- a/documentation/util.rst +++ b/documentation/util.rst @@ -32,7 +32,7 @@ through the environment variable **$PVXS_LOG** by calling `pvxs::logger_config_e .. doxygenfunction:: pvxs::logger_config_env() -If this is undesireable, logger levels may be (reset) manually. +If this is undesirable, logger levels may be (reset) manually. .. doxygenfunction:: pvxs::logger_level_set(const char *, Level) diff --git a/ioc/field.h b/ioc/field.h index b57cac7..be15c3a 100644 --- a/ioc/field.h +++ b/ioc/field.h @@ -42,7 +42,7 @@ public: // points to storage in containing Group::fields std::vector triggers; - // only for Meta mapping. type infered from dbChannelFinalFieldType() + // only for Meta mapping. type inferred from dbChannelFinalFieldType() Value anyType; Field(const FieldDefinition& def); diff --git a/ioc/iochooks.cpp b/ioc/iochooks.cpp index 37f91d9..fe50e6d 100644 --- a/ioc/iochooks.cpp +++ b/ioc/iochooks.cpp @@ -432,7 +432,7 @@ bool enable2() { enable ? "ENABLED" : "disabled"); if(!permit) { - printf(" Not permitted due to confict with QSRV1.\n" + printf(" Not permitted due to conflict with QSRV1.\n" " Remove qsrv.dbd from IOC.\n"); } } diff --git a/ioc/pvalink.h b/ioc/pvalink.h index ce3bf9f..2861542 100644 --- a/ioc/pvalink.h +++ b/ioc/pvalink.h @@ -114,7 +114,7 @@ struct linkGlobal_t final : private epicsThreadRunable { // a tuple of channel name and printed pvRequest (or Monitor) typedef std::pair channels_key_t; - // pvaLinkChannel dtor prunes dead entires + // pvaLinkChannel dtor prunes dead entries typedef std::map > channels_t; // Cache of active Channels (really about caching Monitor) channels_t channels; diff --git a/qsrv/softMain.cpp b/qsrv/softMain.cpp index eb98d32..aa8b0bb 100644 --- a/qsrv/softMain.cpp +++ b/qsrv/softMain.cpp @@ -67,7 +67,7 @@ void usage(const char *arg0, const std::string& base_dbd) { " -D If used, must come first. Specify the path to the softIoc.dbdfile." " The compile-time install location is saved in the binary as a default.\n" "\n" - " -h Print this mesage and exit.\n" + " -h Print this message and exit.\n" "\n" " -V Print version and exit.\n" "\n" diff --git a/src/bitmask.h b/src/bitmask.h index 66a1c94..55a4eba 100644 --- a/src/bitmask.h +++ b/src/bitmask.h @@ -61,7 +61,7 @@ BitAnd, BitBase> operator &(const BitBase& lhs, const BitBase& rhs) { if(lhs.size()!=rhs.size()) - throw std::logic_error("op size mis-match"); // this sucks, need to figure out a way to handle different size input + throw std::logic_error("op size mismatch"); // this sucks, need to figure out a way to handle different size input return BitAnd, BitBase>{lhs, rhs}; } @@ -82,7 +82,7 @@ BitOr, BitBase> operator |(const BitBase& lhs, const BitBase& rhs) { if(lhs.size()!=rhs.size()) - throw std::logic_error("op size mis-match"); + throw std::logic_error("op size mismatch"); return BitOr, BitBase>{lhs, rhs}; } diff --git a/src/clientget.cpp b/src/clientget.cpp index 2483547..19dee0a 100644 --- a/src/clientget.cpp +++ b/src/clientget.cpp @@ -54,7 +54,7 @@ struct PRBase::Args for(auto& name : names) { auto it = values.find(name); if(it==values.end()) - throw std::logic_error("uriArgs() names vs. values mis-match"); + throw std::logic_error("uriArgs() names vs. values mismatch"); auto& value = it->second.first; diff --git a/src/log.cpp b/src/log.cpp index cdac0cc..46e4952 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -285,8 +285,8 @@ Level logger::init() void xerrlogHexPrintf(const void *buf, size_t buflen) { const auto cbuf = static_cast(buf); - bool elipsis = buflen > 64u; - if(elipsis) + bool ellipsis = buflen > 64u; + if(ellipsis) buflen = 64u; // whole buffer @@ -318,7 +318,7 @@ void xerrlogHexPrintf(const void *buf, size_t buflen) errlogPrintf("%04x : %s %s %s %s\n", addr, buf[0], buf[1], buf[2], buf[3]); } - if(elipsis) + if(ellipsis) errlogPrintf("...\n"); } diff --git a/src/pvaproto.h b/src/pvaproto.h index b8de7e6..81491ea 100644 --- a/src/pvaproto.h +++ b/src/pvaproto.h @@ -172,7 +172,7 @@ inline void _to_wire(Buffer& buf, const uint8_t *mem, bool reverse, const char * return; } else if(reverse) { - // byte order mis-match + // byte order mismatch for(unsigned i=0; i ignoreAddrs; //! Addresses (**not** host names) to which (UDP) beacons message will be sent. //! May include broadcast and/or unicast addresses. - //! Supplemented iif auto_beacon==true + //! Supplemented only if auto_beacon==true std::vector beaconDestinations; //! TCP port to bind. Default is 5075. May be zero. unsigned short tcp_port = 5075; diff --git a/src/pvxs/source.h b/src/pvxs/source.h index 9f79b4b..3421f26 100644 --- a/src/pvxs/source.h +++ b/src/pvxs/source.h @@ -62,7 +62,7 @@ struct MonitorStat { size_t maxQueue=0; //! Negotiated limit on nQueue size_t limitQueue=0; - //! Number of updates squashed during post() calss + //! Number of updates squashed during post() calls //! @since 1.2.0 size_t nSquash=0; diff --git a/src/pvxs/version.h b/src/pvxs/version.h index 18d5741..9eafd7c 100644 --- a/src/pvxs/version.h +++ b/src/pvxs/version.h @@ -77,7 +77,7 @@ unsigned long version_abi_int(); /** Runtime ABI check. * - * This test is only meaningful if it is preformed prior to any + * This test is only meaningful if it is performed prior to any * other library calls. * * It is guaranteed that the library has no global constructors. diff --git a/test/benchdata.cpp b/test/benchdata.cpp index 82a4ab4..9866fa8 100644 --- a/test/benchdata.cpp +++ b/test/benchdata.cpp @@ -83,7 +83,7 @@ void benchAllocNTScalar() constexpr size_t niter = 1000u; - const Value protoype(nt::NTScalar{TypeCode::UInt64, true, true, true}.create()); + const Value prototype(nt::NTScalar{TypeCode::UInt64, true, true, true}.create()); std::vector can(niter); @@ -93,7 +93,7 @@ void benchAllocNTScalar() StopWatch W; (void)W.click(); - can[n] = protoype.cloneEmpty(); + can[n] = prototype.cloneEmpty(); S.sample(W.click()); } diff --git a/test/testpvalink.cpp b/test/testpvalink.cpp index 11d2b49..6a664c5 100644 --- a/test/testpvalink.cpp +++ b/test/testpvalink.cpp @@ -473,7 +473,7 @@ namespace { testdbGetFieldEqual("enum:tgt:s", DBR_STRING, "one"); // not clear how to handle this case, where a string is // read as DBR_USHORT, which is actually as DBF_ENUM - testTodoBegin("Not yet implimented"); + testTodoBegin("Not yet implemented"); testdbGetFieldEqual("enum:tgt:b", DBR_STRING, "one"); testTodoEnd(); } diff --git a/tools/mshim.cpp b/tools/mshim.cpp index 41a070a..18257c5 100644 --- a/tools/mshim.cpp +++ b/tools/mshim.cpp @@ -242,8 +242,8 @@ int main(int argc, char *argv[]) auto manager(UDPManager::instance()); std::vector> listeners; - auto onS = [&app](const UDPManager::Search& msg) {app.onSearch(msg);}; - auto onB = [&app](const UDPManager::Beacon& msg) {app.onBeacon(msg);}; + auto onSearch = [&app](const UDPManager::Search& msg) {app.onSearch(msg);}; + auto onBeacon = [&app](const UDPManager::Beacon& msg) {app.onBeacon(msg);}; { int opt; @@ -252,8 +252,8 @@ int main(int argc, char *argv[]) case 'L': { SockEndpoint ep(parseEP(optarg, conf)); - listeners.push_back(manager.onSearch(ep, onS)); - listeners.push_back(manager.onBeacon(ep, onB)); + listeners.push_back(manager.onSearch(ep, onSearch)); + listeners.push_back(manager.onBeacon(ep, onBeacon)); break; } case 'F':