From e4ae671b4983b4917431bd4b1163818b090a907d Mon Sep 17 00:00:00 2001 From: sciencewhiz Date: Thu, 14 May 2026 21:55:02 -0700 Subject: [PATCH] [ci] Add CI spelling check and fix spelling errors (#8882) reviewdog/action-misspell is used on frc-docs. It has a dictionary of commonly misspelled words, so it has less false positives then other tools. --- .github/workflows/lint-format.yml | 24 +++++++++++++++++++ ntcore/src/test/python/test_network_table.py | 6 ++--- styleguide/spotbugs-exclude.xml | 2 +- .../include/wpi/framework/RobotBase.hpp | 2 +- .../wpilib/src/rpy/SmartDashboardData.cpp | 2 +- .../org/wpilib/math/optimization/Problem.java | 2 +- .../wpilib/math/optimization/ProblemJNI.java | 2 +- .../wpi/math/controller/PIDController.hpp | 2 +- .../org/wpilib/util/struct/StructFetcher.java | 2 +- 9 files changed, 34 insertions(+), 10 deletions(-) diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml index 15b0005e59..376ee14ea4 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -123,3 +123,27 @@ jobs: echo '' >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY if: ${{ failure() }} + + check-spelling: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + - name: misspell + uses: reviewdog/action-misspell@v1 + with: + reporter: "github-check" + fail_level: "error" + exclude: | + **/*.svg + **/thirdparty/** + **/upstream_utils/** + **/generated/** + ./wpigui/src/main/native/cpp/portable-file-dialogs.* + ./wpimath/src/main/native/include/wpi/units/base.hpp + ./wpinet/src/main/native/linux/AvahiClient.* + ./wpinet/src/main/native/cpp/http_parser.cpp + ./wpinet/src/main/native/include/wpi/net/http_parser.hpp + ./wpiutil/src/main/native/include/wpi/util/FastQueue.hpp + ./wpiutil/src/test/native/cpp/json/** + ./wpiutil/src/test/native/cpp/llvm/** + ./wpiutil/src/test/native/cpp/span/** diff --git a/ntcore/src/test/python/test_network_table.py b/ntcore/src/test/python/test_network_table.py index e8bd0d4930..65c46d50df 100644 --- a/ntcore/src/test/python/test_network_table.py +++ b/ntcore/src/test/python/test_network_table.py @@ -19,21 +19,21 @@ def test_put_double(table1): table1.putNumber("double", 42.42) assert table1.getNumber("double", None) == 42.42 - assert table1.getNumber("Non-Existant", 44.44) == 44.44 + assert table1.getNumber("Non-Existent", 44.44) == 44.44 def test_put_boolean(table1): table1.putBoolean("boolean", True) assert table1.getBoolean("boolean", None) == True - assert table1.getBoolean("Non-Existant", False) == False + assert table1.getBoolean("Non-Existent", False) == False def test_put_string(table1): table1.putString("String", "Test 1") assert table1.getString("String", None) == "Test 1" - assert table1.getString("Non-Existant", "Test 3") == "Test 3" + assert table1.getString("Non-Existent", "Test 3") == "Test 3" def test_getvalue_overloads(table1): diff --git a/styleguide/spotbugs-exclude.xml b/styleguide/spotbugs-exclude.xml index e9ed00d855..f0d05cc3d2 100644 --- a/styleguide/spotbugs-exclude.xml +++ b/styleguide/spotbugs-exclude.xml @@ -41,7 +41,7 @@ diff --git a/wpilibc/src/main/native/include/wpi/framework/RobotBase.hpp b/wpilibc/src/main/native/include/wpi/framework/RobotBase.hpp index 7ae472681a..ee1db0fcd7 100644 --- a/wpilibc/src/main/native/include/wpi/framework/RobotBase.hpp +++ b/wpilibc/src/main/native/include/wpi/framework/RobotBase.hpp @@ -64,7 +64,7 @@ int StartRobot() { if (!WPI_IsRuntimeValid(&foundMajor, &foundMinor, &expectedMajor, &expectedMinor, &runtimePath)) { // We could make this error better, however unlike Java, there is only a - // single scenario that could be occuring. The entirety of VS is too out + // single scenario that could be occurring. The entirety of VS is too out // of date. In most cases the linker should detect this, but not always. fmt::println( "Your copy of Visual Studio is out of date. Please update it.\n"); diff --git a/wpilibc/src/main/python/wpilib/src/rpy/SmartDashboardData.cpp b/wpilibc/src/main/python/wpilib/src/rpy/SmartDashboardData.cpp index 9b8d430024..9e3f1c2dba 100644 --- a/wpilibc/src/main/python/wpilib/src/rpy/SmartDashboardData.cpp +++ b/wpilibc/src/main/python/wpilib/src/rpy/SmartDashboardData.cpp @@ -35,7 +35,7 @@ void destroySmartDashboardData() { // is unwinding static objects after interpreter destruction sdData.dec_ref(); // release our reference to this otherwise the destructor will try to - // delete a non-existant PyObject* after interpreter destruction + // delete a non-existent PyObject* after interpreter destruction sdData.release(); } } diff --git a/wpimath/src/main/java/org/wpilib/math/optimization/Problem.java b/wpimath/src/main/java/org/wpilib/math/optimization/Problem.java index 7d5502e52a..9630036ab3 100644 --- a/wpimath/src/main/java/org/wpilib/math/optimization/Problem.java +++ b/wpimath/src/main/java/org/wpilib/math/optimization/Problem.java @@ -108,7 +108,7 @@ public class Problem implements AutoCloseable { *

Decision variables have an initial value of zero. * * @param rows Number of matrix rows. - * @return A symmetric matrix of decision varaibles in the optimization problem. + * @return A symmetric matrix of decision variables in the optimization problem. */ public VariableMatrix symmetricDecisionVariable(int rows) { return new VariableMatrix(rows, rows, ProblemJNI.symmetricDecisionVariable(m_handle, rows)); diff --git a/wpimath/src/main/java/org/wpilib/math/optimization/ProblemJNI.java b/wpimath/src/main/java/org/wpilib/math/optimization/ProblemJNI.java index c3f22ca8c7..2a42a694bc 100644 --- a/wpimath/src/main/java/org/wpilib/math/optimization/ProblemJNI.java +++ b/wpimath/src/main/java/org/wpilib/math/optimization/ProblemJNI.java @@ -40,7 +40,7 @@ final class ProblemJNI extends WPIMathJNI { * * @param handle Problem handle. * @param rows Number of matrix rows. - * @return A symmetric matrix of decision varaibles in the optimization problem. + * @return A symmetric matrix of decision variables in the optimization problem. */ static native long[] symmetricDecisionVariable(long handle, int rows); diff --git a/wpimath/src/main/native/include/wpi/math/controller/PIDController.hpp b/wpimath/src/main/native/include/wpi/math/controller/PIDController.hpp index 5d891dc442..a1155ce3d6 100644 --- a/wpimath/src/main/native/include/wpi/math/controller/PIDController.hpp +++ b/wpimath/src/main/native/include/wpi/math/controller/PIDController.hpp @@ -229,7 +229,7 @@ class WPILIB_DLLEXPORT PIDController /** * Returns true if the error is within the tolerance of the setpoint. - * The error tolerance defauls to 0.05, and the error derivative tolerance + * The error tolerance defaults to 0.05, and the error derivative tolerance * defaults to ∞. * * This will return false until at least one input value has been computed. diff --git a/wpiutil/src/main/java/org/wpilib/util/struct/StructFetcher.java b/wpiutil/src/main/java/org/wpilib/util/struct/StructFetcher.java index dde2d347b7..b222a4950c 100644 --- a/wpiutil/src/main/java/org/wpilib/util/struct/StructFetcher.java +++ b/wpiutil/src/main/java/org/wpilib/util/struct/StructFetcher.java @@ -48,7 +48,7 @@ public final class StructFetcher { /** * Returns a {@link Struct} for the given class. This does not do compile time checking that the - * class is a {@link StructSerializable}. Whenever possible it is reccomended to use {@link + * class is a {@link StructSerializable}. Whenever possible it is recommended to use {@link * #fetchStruct(Class)}. * * @param clazz The class object to extract the struct from.