From d55f8fbaf1b09d1f50c991d30984f5fed36d3a9b Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 14 Jul 2021 11:23:02 -0400 Subject: [PATCH] style: fix and add spelling check (#615) * style: fix and add spelling check * Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 14 ++++++++++++++ docs/mainpage.md | 2 +- include/CLI/Macros.hpp | 2 +- include/CLI/TypeTools.hpp | 2 +- tests/ConfigFileTest.cpp | 2 +- tests/OptionGroupTest.cpp | 2 +- tests/StringParseTest.cpp | 2 +- 7 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b580f53e..53624dbc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,3 +39,17 @@ repos: hooks: - id: cmake-format additional_dependencies: [pyyaml] + +- repo: local + hooks: + - id: disallow-caps + name: Disallow improper capitalization + language: pygrep + entry: PyBind|Numpy|Cmake|CCache|PyTest|Github + exclude: .pre-commit-config.yaml + +- repo: https://github.com/codespell-project/codespell + rev: v2.1.0 + hooks: + - id: codespell + args: ["-L", "atleast,ans,doub,inout"] diff --git a/docs/mainpage.md b/docs/mainpage.md index 0721653d..e8647181 100644 --- a/docs/mainpage.md +++ b/docs/mainpage.md @@ -1,6 +1,6 @@ # Introduction {#mainpage} -This is the Doxygen API documentation for CLI11 parser. There is a friendly introduction to CLI11 on the [Github page](https://github.com/CLIUtils/CLI11), and [a tutorial series](https://cliutils.github.io/CLI11/book/). +This is the Doxygen API documentation for CLI11 parser. There is a friendly introduction to CLI11 on the [GitHub page](https://github.com/CLIUtils/CLI11), and [a tutorial series](https://cliutils.github.io/CLI11/book/). The main classes are: diff --git a/include/CLI/Macros.hpp b/include/CLI/Macros.hpp index 778fec7d..7398ed77 100644 --- a/include/CLI/Macros.hpp +++ b/include/CLI/Macros.hpp @@ -8,7 +8,7 @@ // [CLI11:macros_hpp:verbatim] -// The following version macro is very similar to the one in PyBind11 +// The following version macro is very similar to the one in pybind11 #if !(defined(_MSC_VER) && __cplusplus == 199711L) && !defined(__INTEL_COMPILER) #if __cplusplus >= 201402L #define CLI11_CPP14 diff --git a/include/CLI/TypeTools.hpp b/include/CLI/TypeTools.hpp index be0e89ab..1736b13a 100644 --- a/include/CLI/TypeTools.hpp +++ b/include/CLI/TypeTools.hpp @@ -1059,7 +1059,7 @@ bool lexical_cast(const std::string &input, T &output) { } // LCOV_EXCL_START // This version of cast is only used for odd cases in an older compilers the fail over - // from_stream is tested elsewhere an not relevent for coverage here + // from_stream is tested elsewhere an not relevant for coverage here return from_stream(input, output); // LCOV_EXCL_STOP } diff --git a/tests/ConfigFileTest.cpp b/tests/ConfigFileTest.cpp index c9577591..fef62d5d 100644 --- a/tests/ConfigFileTest.cpp +++ b/tests/ConfigFileTest.cpp @@ -536,7 +536,7 @@ TEST_CASE_METHOD(TApp, "IniRequiredNoDefault", "[config]") { app.add_option("--two", two); REQUIRE_THROWS_AS(run(), CLI::FileError); // test to make sure help still gets called correctly - // Github issue #533 https://github.com/CLIUtils/CLI11/issues/553 + // GitHub issue #533 https://github.com/CLIUtils/CLI11/issues/553 args = {"--help"}; REQUIRE_THROWS_AS(run(), CLI::CallForHelp); } diff --git a/tests/OptionGroupTest.cpp b/tests/OptionGroupTest.cpp index 175f31dc..b50bff0c 100644 --- a/tests/OptionGroupTest.cpp +++ b/tests/OptionGroupTest.cpp @@ -593,7 +593,7 @@ TEST_CASE_METHOD(ManyGroups, "SameSubcommand", "[optiongroup]") { // so when the subcommands are disabled they can have the same name sub1->disabled(false); sub2->disabled(false); - // if they are reenabled they are not checked for overlap on enabling so they can have the same name + // if they are re-enabled they are not checked for overlap on enabling so they can have the same name args = {"sub1", "sub1", "sub1"}; run(); diff --git a/tests/StringParseTest.cpp b/tests/StringParseTest.cpp index 08f3a8e7..190700ce 100644 --- a/tests/StringParseTest.cpp +++ b/tests/StringParseTest.cpp @@ -79,7 +79,7 @@ TEST_CASE_METHOD(TApp, "ExistingExeCheckWithLotsOfSpace", "[stringparse]") { CHECK(std::string("./") + std::string(tmpexe) == app.get_name()); } -// From Github issue #591 https://github.com/CLIUtils/CLI11/issues/591 +// From GitHub issue #591 https://github.com/CLIUtils/CLI11/issues/591 TEST_CASE_METHOD(TApp, "ProgNameWithSpace", "[stringparse]") { app.add_flag("--foo");