From e70225b8cba2341ce62b14511e1f056ab80ec80d Mon Sep 17 00:00:00 2001 From: Nickolay Olshevsky Date: Wed, 18 Sep 2024 11:59:08 +0300 Subject: [PATCH 1/2] Fix typos in codebase and documentation. --- ci-legacy/lib/install_functions.inc.sh | 6 +++--- ci/build_tarball.sh | 2 +- cmake/CTestCostData.txt | 2 +- cmake/rnp_tests_discover.cmake | 4 ++-- docs/Doxyfile | 2 +- docs/installation.adoc | 4 ++-- include/rekey/rnp_key_store.h | 10 +++++----- include/rnp/rnp.h | 16 ++++++++-------- src/lib/crypto/elgamal.cpp | 2 +- src/lib/rnp.cpp | 4 ++-- src/librekey/key_store_g10.cpp | 4 ++-- src/librepgp/stream-parse.cpp | 2 +- src/librepgp/stream-parse.h | 2 +- src/librepgp/stream-sig.h | 2 +- src/librepgp/stream-write.cpp | 2 +- src/librepgp/stream-write.h | 2 +- src/rnp/rnpcfg.h | 2 +- src/tests/cli_perf.py | 2 +- src/tests/cli_tests.py | 6 +++--- src/tests/ffi-key-prop.cpp | 2 +- src/tests/ffi-key.cpp | 10 +++++----- src/tests/generatekey.cpp | 2 +- 22 files changed, 45 insertions(+), 45 deletions(-) diff --git a/ci-legacy/lib/install_functions.inc.sh b/ci-legacy/lib/install_functions.inc.sh index 98acc82092..e088ef4454 100644 --- a/ci-legacy/lib/install_functions.inc.sh +++ b/ci-legacy/lib/install_functions.inc.sh @@ -103,7 +103,7 @@ linux_prepare_ribose_yum_repo() { # Prepare the system by updating and optionally installing repos yum_prepare_repos() { - yum_install "${util_depedencies_yum[@]}" + yum_install "${util_dependencies_yum[@]}" linux_prepare_ribose_yum_repo "${SUDO}" "${YUM}" -y update if [[ $# -gt 0 ]]; then @@ -141,7 +141,7 @@ linux_install_centos() { esac } -declare util_depedencies_yum=( +declare util_dependencies_yum=( sudo wget git @@ -421,7 +421,7 @@ build_and_install_python() { # Make sure automake is at least $MINIMUM_AUTOMAKE_VERSION (1.16.3) as required by GnuPG 2.3 # - We assume that on fedora/centos ribose rpm was used (see basic_build_dependencies_yum) -# - If automake version is less then reuired automake build it from source +# - If automake version is less then required automake build it from source ensure_automake() { local using_ribose_automake= diff --git a/ci/build_tarball.sh b/ci/build_tarball.sh index 32e51e83a3..03c6b2f2b5 100755 --- a/ci/build_tarball.sh +++ b/ci/build_tarball.sh @@ -66,7 +66,7 @@ cmake -B "${RNP_BLD}" -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF "${RNP_PATH}" cpack -B "${RNP_BLD}" -G TGZ --config "${RNP_BLD}/CPackSourceConfig.cmake" # Check whether tarball builds -# cpack would use symantic versioning for file names, i.e. rnp-v0.17.1 +# cpack would use semantic versioning for file names, i.e. rnp-v0.17.1 RNP_TGZ=$(find "${RNP_BLD}" -maxdepth 1 -type f -name '*.tar.gz' | head -n 1) RNP_CHK="/opt/rnp-check" rm -rf "${RNP_CHK}" diff --git a/cmake/CTestCostData.txt b/cmake/CTestCostData.txt index 03f3c61796..3a895138f2 100644 --- a/cmake/CTestCostData.txt +++ b/cmake/CTestCostData.txt @@ -178,7 +178,7 @@ rnp_tests.rnpkeys_generatekey_verifykeyHomeDirNoPermission 1 0.156128 rnp_tests.rnpkeys_generatekey_testExpertMode 1 3.81493 rnp_tests.generatekeyECDSA_explicitlySetSmallOutputDigest_DigestAlgAdjusted 1 0.0674681 rnp_tests.generatekey_multipleUserIds_ShouldFail 1 0.0532007 -rnp_tests.generatekeyECDSA_explicitlySetBiggerThanNeededDigest_ShouldSuceed 1 0.0640942 +rnp_tests.generatekeyECDSA_explicitlySetBiggerThanNeededDigest_ShouldSucceed 1 0.0640942 rnp_tests.generatekeyECDSA_explicitlySetUnknownDigest_ShouldFail 1 0.0544535 rnp_tests.test_generated_key_sigs 1 0.18236 rnp_tests.test_kbx_nsigs 1 1.03666 diff --git a/cmake/rnp_tests_discover.cmake b/cmake/rnp_tests_discover.cmake index 9f05293762..4b5fced2ab 100644 --- a/cmake/rnp_tests_discover.cmake +++ b/cmake/rnp_tests_discover.cmake @@ -9,7 +9,7 @@ function(add_command NAME) endfunction() if(NOT EXISTS "${TEST_EXECUTABLE}") - message(FATAL_ERROR "Executable does not exist: ${TEST_EXECUTABE}") + message(FATAL_ERROR "Executable does not exist: ${TEST_EXECUTABLE}") endif() execute_process( COMMAND "${TEST_EXECUTABLE}" list-tests @@ -18,7 +18,7 @@ execute_process( RESULT_VARIABLE result ) if(NOT ${result} EQUAL 0) - message(FATAL_ERROR "Error running executable: ${TEST_EXECUTABE}") + message(FATAL_ERROR "Error running executable: ${TEST_EXECUTABLE}") endif() string(REPLACE "\n" ";" output "${output}") diff --git a/docs/Doxyfile b/docs/Doxyfile index c38597d469..e0b2dc16f4 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -85,7 +85,7 @@ CREATE_SUBDIRS = NO # level increment doubles the number of directories, resulting in 4096 # directories at level 8 which is the default and also the maximum value. The # sub-directories are organized in 2 levels, the first level always has a fixed -# numer of 16 directories. +# number of 16 directories. # Minimum value: 0, maximum value: 8, default value: 8. # This tag requires that the tag CREATE_SUBDIRS is set to YES. diff --git a/docs/installation.adoc b/docs/installation.adoc index 575e88d2df..c919921792 100644 --- a/docs/installation.adoc +++ b/docs/installation.adoc @@ -177,7 +177,7 @@ make && make install === Using Microsoft Visual Studio 2019 and vcpkg -Use appropriate command propmpt for your target platform, for example "x64 Native Tools Command Prompt for VS 2019" +Use appropriate command prompt for your target platform, for example "x64 Native Tools Command Prompt for VS 2019" ``` cmd /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat" ``` @@ -225,7 +225,7 @@ Ensure that the following dependencies are available on path: === Using Microsoft Visual Studio 2019 and pre-installed libraries -Use appropriate command propmpt for your target platform, for example "x64 Native Tools Command Prompt for VS 2019" +Use appropriate command prompt for your target platform, for example "x64 Native Tools Command Prompt for VS 2019" ``` cmd /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat" ``` diff --git a/include/rekey/rnp_key_store.h b/include/rekey/rnp_key_store.h index de55ecd7c7..bd011876f5 100644 --- a/include/rekey/rnp_key_store.h +++ b/include/rekey/rnp_key_store.h @@ -179,13 +179,13 @@ class KeyStore { /** * @brief Add signature of the specific key to the keystore, revalidating and refresing - * key's data. Currently supports only direct-key or subkey binding signature. + * key's data. Currently supports only direct-key or subkey binding signature. * * @param keyfp key's fingerprint. * @param sig signature packet. - * @param front set to true if signature should be added to the beggining of the signature - * list. - * @return pgp_subsig_t* + * @param front set to true if signature should be added to the beginning of the signature + * list. + * @return pointer to the newly added signature or NULL if failed. */ pgp_subsig_t *add_key_sig(const pgp_fingerprint_t &keyfp, const pgp_signature_t & sig, @@ -238,7 +238,7 @@ class KeyStore { * * @param key key to remove. Must be from this keystore. * @param subkeys remove subkeys or not. - * @return true if key was succesfully removed, or false if key was not found in keystore. + * @return true if key was successfully removed, or false if key was not found in keystore. */ bool remove_key(const pgp_key_t &key, bool subkeys = false); diff --git a/include/rnp/rnp.h b/include/rnp/rnp.h index 1f7e5c2adb..bb33fedac1 100644 --- a/include/rnp/rnp.h +++ b/include/rnp/rnp.h @@ -960,7 +960,7 @@ RNP_API rnp_result_t rnp_generate_key_ex(rnp_ffi_t ffi, * @param op pointer to opaque key generation context. * @param ffi * @param alg key algorithm as string. Must be able to sign. Currently the following algorithms - * are supported (case-insensetive) : 'rsa', 'dsa', 'ecdsa', 'eddsa', 'sm2'. + * are supported (case-insensitive) : 'rsa', 'dsa', 'ecdsa', 'eddsa', 'sm2'. * @return RNP_SUCCESS or error code if failed. */ RNP_API rnp_result_t rnp_op_generate_create(rnp_op_generate_t *op, @@ -976,7 +976,7 @@ RNP_API rnp_result_t rnp_op_generate_create(rnp_op_generate_t *op, * @param ffi * @param primary primary key handle, must have secret part. * @param alg key algorithm as string. Currently the following algorithms are supported - * (case-insensetive) : 'rsa', 'dsa', 'elgamal', 'ecdsa', 'eddsa', 'ecdh', 'sm2'. + * (case-insensitive) : 'rsa', 'dsa', 'elgamal', 'ecdsa', 'eddsa', 'ecdh', 'sm2'. * @return RNP_SUCCESS or error code if failed. */ RNP_API rnp_result_t rnp_op_generate_subkey_create(rnp_op_generate_t *op, @@ -1190,7 +1190,7 @@ RNP_API rnp_result_t rnp_op_generate_set_pref_keyserver(rnp_op_generate_t op, #if defined(RNP_EXPERIMENTAL_CRYPTO_REFRESH) /** Set the generated key version to v6. - * NOTE: This is an experimantal feature and this function can be replaced (or removed) at any + * NOTE: This is an experimental feature and this function can be replaced (or removed) at any * time. * * @param op pointer to opaque key generation context. @@ -1201,7 +1201,7 @@ RNP_API rnp_result_t rnp_op_generate_set_v6_key(rnp_op_generate_t op); #if defined(RNP_EXPERIMENTAL_PQC) /** Set the SPHINCS+ parameter set - * NOTE: This is an experimantal feature and this function can be replaced (or removed) at any + * NOTE: This is an experimental feature and this function can be replaced (or removed) at any * time. * * @param op pointer to opaque key generation context. @@ -1686,7 +1686,7 @@ RNP_API rnp_result_t rnp_uid_get_signature_at(rnp_uid_handle_t uid, * - 'certification revocation' : certification revocation signature * - 'timestamp' : timestamp signature * - 'third-party' : third party confirmation signature - * - 'uknown: 0..255' : unknown signature with its type specified as number + * - 'unknown: 0..255' : unknown signature with its type specified as number * * @return RNP_SUCCESS or error code if failed. */ @@ -2685,7 +2685,7 @@ RNP_API rnp_result_t rnp_op_verify_set_flags(rnp_op_verify_t op, uint32_t flags) * @return RNP_SUCCESS if data was processed successfully and output may be used. By default * this means at least one valid signature for the signed data, or successfully * decrypted data if no signatures are present. - * This behaviour may be overriden via rnp_op_verify_set_flags() call. + * This behaviour may be overridden via rnp_op_verify_set_flags() call. * * To check number of signatures and their verification status use functions * rnp_op_verify_get_signature_count() and rnp_op_verify_get_signature_at(). @@ -3327,7 +3327,7 @@ RNP_API rnp_result_t rnp_op_encrypt_set_compression(rnp_op_encrypt_t op, * RNP_ENCRYPT_NOWRAP - do not wrap the data in a literal data packet. This * would allow to encrypt already signed data. * - * @return RNP_SUCESS or error code if failed. + * @return RNP_SUCCESS or error code if failed. */ RNP_API rnp_result_t rnp_op_encrypt_set_flags(rnp_op_encrypt_t op, uint32_t flags); @@ -3462,7 +3462,7 @@ RNP_API rnp_result_t rnp_get_secret_key_data(rnp_key_handle_t handle, * The format of the "mpis" object in the "signatures", "public key" and * "secret key" members may vary and depends on the key algorithm. * But generally they contain hexadecimal strings representing - * MPI-s (multi-presicion integers) of the key or signature.\n + * MPI-s (multi-precision integers) of the key or signature.\n * "mpis" objects are present if the flags argument contains * RNP_JSON_SIGNATURE_MPIS,RNP_JSON_PUBLIC_MPIS and RNP_JSON_SECRET_MPIS * flag respectively.\n diff --git a/src/lib/crypto/elgamal.cpp b/src/lib/crypto/elgamal.cpp index ec9b7597b2..4feda904a5 100644 --- a/src/lib/crypto/elgamal.cpp +++ b/src/lib/crypto/elgamal.cpp @@ -173,7 +173,7 @@ elgamal_encrypt_pkcs1(rnp::RNG * rng, /* * Botan's ElGamal formats the g^k and msg*(y^k) together into a single byte string. * We have to parse out the two values after encryption, as rnp stores those values - * separatelly. + * separately. * * We don't trim zeros from octet string as it is done before final marshalling * (add_packet_body_mpi) diff --git a/src/lib/rnp.cpp b/src/lib/rnp.cpp index 3782a7b9af..d580609869 100644 --- a/src/lib/rnp.cpp +++ b/src/lib/rnp.cpp @@ -972,7 +972,7 @@ try { } } - // set pathes + // set paths *pub_path = strdup(pub.c_str()); *sec_path = strdup(sec.c_str()); @@ -4746,7 +4746,7 @@ gen_json_primary_key(rnp_ffi_t ffi, rnp_keygen_primary_desc_t desc = {}; // desc.crypto is a union // so at least Clang 12 on Windows zero-initializes the first union member only - // keeping the "larger" member partially unintialized + // keeping the "larger" member partially uninitialized desc.crypto.dsa.q_bitlen = 0; desc.cert.key_expiration = DEFAULT_KEY_EXPIRATION; diff --git a/src/librekey/key_store_g10.cpp b/src/librekey/key_store_g10.cpp index 51e695d391..812f4d9970 100644 --- a/src/librekey/key_store_g10.cpp +++ b/src/librekey/key_store_g10.cpp @@ -249,7 +249,7 @@ lookup_var(const sexp_list_t *list, const std::string &name) noexcept // We are looking for a list element (condition 1) // that: // -- has at least two SEXP elements (condition 2) - // -- has a SEXP string at 0 postion (condition 3) + // -- has a SEXP string at 0 position (condition 3) // matching given name (condition 4) auto match = [name](const std::shared_ptr &ptr) { bool r = false; @@ -515,7 +515,7 @@ decrypt_protected_section(const sexp_simple_string_t &encrypted_data, // find the protection format in our table info = find_format(prot.symm_alg, prot.cipher_mode, prot.s2k.hash_alg); if (!info) { - RNP_LOG("Unsupported format, alg: %d, chiper_mode: %d, hash: %d", + RNP_LOG("Unsupported format, alg: %d, cipher_mode: %d, hash: %d", prot.symm_alg, prot.cipher_mode, prot.s2k.hash_alg); diff --git a/src/librepgp/stream-parse.cpp b/src/librepgp/stream-parse.cpp index be39149c81..0b98b4fa18 100644 --- a/src/librepgp/stream-parse.cpp +++ b/src/librepgp/stream-parse.cpp @@ -151,7 +151,7 @@ typedef struct pgp_source_signed_param_t { pgp_literal_hdr_t lhdr{}; bool has_lhdr = false; - std::vector onepasses; /* list of one-pass singatures */ + std::vector onepasses; /* list of one-pass signatures */ std::list sigs; /* list of signatures */ std::vector siginfos; /* signature validation info */ rnp::HashList hashes; /* hash contexts */ diff --git a/src/librepgp/stream-parse.h b/src/librepgp/stream-parse.h index 2af2fbc36a..47dbabe075 100644 --- a/src/librepgp/stream-parse.h +++ b/src/librepgp/stream-parse.h @@ -61,7 +61,7 @@ typedef struct pgp_parse_handler_t { pgp_password_provider_t *password_provider; /* if NULL then default will be used */ rnp::KeyProvider * key_provider; /* must be set when key is required, i.e. during signing/verification/public key encryption and - deryption */ + decryption */ pgp_destination_func_t *dest_provider; /* called when destination stream is required */ pgp_source_func_t * src_provider; /* required to provider source during the detached signature verification */ diff --git a/src/librepgp/stream-sig.h b/src/librepgp/stream-sig.h index 9c209523c4..a3118974de 100644 --- a/src/librepgp/stream-sig.h +++ b/src/librepgp/stream-sig.h @@ -324,7 +324,7 @@ typedef struct pgp_signature_t { std::string signer_uid() const; /** - * @brief Set the signer's uid, responcible for the signature creation. See the RFC + * @brief Set the signer's uid, responsible for the signature creation. See the RFC * 4880bis, 5.2.3.23 for details. */ void set_signer_uid(const std::string &uid); diff --git a/src/librepgp/stream-write.cpp b/src/librepgp/stream-write.cpp index b1c7fc13d9..f50cd3601a 100644 --- a/src/librepgp/stream-write.cpp +++ b/src/librepgp/stream-write.cpp @@ -1007,7 +1007,7 @@ init_encrypted_dst(pgp_write_handler_t *handler, pgp_dest_t *dst, pgp_dest_t *wr skeycount = handler->ctx->passwords.size(); #if defined(ENABLE_CRYPTO_REFRESH) - /* in the case of PKESK (pkeycount > 0) and all keys are PKESKv6/SEIPDv2 capable, ugprade + /* in the case of PKESK (pkeycount > 0) and all keys are PKESKv6/SEIPDv2 capable, upgrade * to AEADv2 */ if (handler->ctx->enable_pkesk_v6 && handler->ctx->pkeskv6_capable() && pkeycount > 0) { param->auth_type = rnp::AuthType::AEADv2; diff --git a/src/librepgp/stream-write.h b/src/librepgp/stream-write.h index d4b12ce8f6..7104999745 100644 --- a/src/librepgp/stream-write.h +++ b/src/librepgp/stream-write.h @@ -52,7 +52,7 @@ typedef struct pgp_write_handler_t { **/ rnp_result_t rnp_sign_src(pgp_write_handler_t *handler, pgp_source_t *src, pgp_dest_t *dst); -/** @brief encrypt and sign the input data. Signatures will be enrypted together with data. +/** @brief encrypt and sign the input data. Signatures will be encrypted together with data. * @param handler handler handler to respond on stream processor callbacks, and additional * processing parameters, including rnp_ctx_t * @param src input source: file, stdin, memory, whatever else conforming to pgp_source_t diff --git a/src/rnp/rnpcfg.h b/src/rnp/rnpcfg.h index 97b37d8289..eda6960efe 100644 --- a/src/rnp/rnpcfg.h +++ b/src/rnp/rnpcfg.h @@ -76,7 +76,7 @@ #define CFG_EXPERT "expert" /* expert key generation mode */ #define CFG_ZLEVEL "zlevel" /* compression level: 0..9 (0 for no compression) */ #define CFG_ZALG "zalg" /* compression algorithm: zip, zlib or bzip2 */ -#define CFG_AEAD "aead" /* if nonzero then AEAD enryption mode, int */ +#define CFG_AEAD "aead" /* if nonzero then AEAD encryption mode, int */ #define CFG_AEAD_CHUNK "aead_chunk" /* AEAD chunk size bits, int from 0 to 56 */ #define CFG_KEYSTORE_DISABLED \ "disable_keystore" /* indicates whether keystore must be initialized */ diff --git a/src/tests/cli_perf.py b/src/tests/cli_perf.py index 9015292862..c3c83f0d84 100755 --- a/src/tests/cli_perf.py +++ b/src/tests/cli_perf.py @@ -289,7 +289,7 @@ def large_file_armored_decryption(self): action="store_true") args = parser.parse_args() - # get list of benchamrks to run + # get list of benchmarks to run bench_methods = [ x[0] for x in inspect.getmembers(Benchmark, predicate=lambda x: inspect.ismethod(x) or inspect.isfunction(x))] print(bench_methods) diff --git a/src/tests/cli_tests.py b/src/tests/cli_tests.py index b679f8b6aa..c74818681b 100755 --- a/src/tests/cli_tests.py +++ b/src/tests/cli_tests.py @@ -1556,7 +1556,7 @@ def test_export_keys(self): # Re-import it, making sure file was correctly overwritten ret, _, _ = run_proc(RNPK, ['--homedir', RNPDIR, '--import', kpub]) self.assertEqual(ret, 0) - # Enter 'y' in ovewrite prompt + # Enter 'y' in overwrite prompt with open(kpub, 'w+') as f: f.truncate(10) ret, out, err = run_proc(RNPK, ['--homedir', RNPDIR, '--export-key', 'alice', '--output', kpub, '--notty'], 'y\n') @@ -3682,7 +3682,7 @@ def test_ext_adding_stripping(self): ret, _, _ = run_proc(RNP, ['--homedir', RNPDIR, '--enarmor=msg', src]) self.assertEqual(ret, 0) self.assertTrue(os.path.isfile(asc)) - # Dearmor asc - must be outputed to src + # Dearmor asc - must be outputted to src os.remove(src) ret, _, _ = run_proc(RNP, ['--homedir', RNPDIR, '--dearmor', asc]) self.assertEqual(ret, 0) @@ -4156,7 +4156,7 @@ class Encryption(unittest.TestCase): to wait until everything else gets tested before your failing BLOWFISH ''' - # Ciphers list tro try during encryption. None will use default + # Ciphers list to try during encryption. None will use default CIPHERS = [None] SIZES = [20, 40, 120, 600, 1000, 5000, 20000, 250000] # Compression parameters to try during encryption(s) diff --git a/src/tests/ffi-key-prop.cpp b/src/tests/ffi-key-prop.cpp index 95185cfa29..d455ec33f8 100644 --- a/src/tests/ffi-key-prop.cpp +++ b/src/tests/ffi-key-prop.cpp @@ -687,7 +687,7 @@ TEST_F(rnp_tests, test_ffi_key_set_expiry) assert_false(sub->pub->valid()); assert_false(sub->sec->valid()); creation = 0; - uint32_t validity = 2 * 30 * 24 * 60 * 60; // 2 monthes + uint32_t validity = 2 * 30 * 24 * 60 * 60; // 2 months assert_rnp_success(rnp_key_get_creation(key, &creation)); uint32_t keytill = creation + validity; creation = time(NULL) - creation; diff --git a/src/tests/ffi-key.cpp b/src/tests/ffi-key.cpp index a456f21632..cd391d7a08 100644 --- a/src/tests/ffi-key.cpp +++ b/src/tests/ffi-key.cpp @@ -39,16 +39,16 @@ static void check_key_properties(rnp_key_handle_t key, - bool primary_exptected, + bool primary_expected, bool have_public_expected, bool have_secret_expected) { - bool isprimary = !primary_exptected; + bool isprimary = !primary_expected; assert_rnp_success(rnp_key_is_primary(key, &isprimary)); - assert_true(isprimary == primary_exptected); - bool issub = primary_exptected; + assert_true(isprimary == primary_expected); + bool issub = primary_expected; assert_rnp_success(rnp_key_is_sub(key, &issub)); - assert_true(issub == !primary_exptected); + assert_true(issub == !primary_expected); bool have_public = !have_public_expected; assert_rnp_success(rnp_key_have_public(key, &have_public)); assert_true(have_public == have_public_expected); diff --git a/src/tests/generatekey.cpp b/src/tests/generatekey.cpp index 0c3bd3d9bb..1cc18e01cc 100644 --- a/src/tests/generatekey.cpp +++ b/src/tests/generatekey.cpp @@ -952,7 +952,7 @@ TEST_F(rnp_tests, generatekey_multipleUserIds_ShouldFail) rnp.end(); } -TEST_F(rnp_tests, generatekeyECDSA_explicitlySetBiggerThanNeededDigest_ShouldSuceed) +TEST_F(rnp_tests, generatekeyECDSA_explicitlySetBiggerThanNeededDigest_ShouldSucceed) { cli_rnp_t rnp; rnp_cfg ops; From 113ed54e9d03785cb4df51a6fb654ef9d3a29909 Mon Sep 17 00:00:00 2001 From: Nickolay Olshevsky Date: Wed, 18 Sep 2024 12:03:15 +0300 Subject: [PATCH 2/2] Add typos check action and config. --- .github/workflows/lint.yml | 11 ++++++++++- _typos.toml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 _typos.toml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ffa1b1c904..5fce5a8d62 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -40,6 +40,16 @@ jobs: scandir: './ci' env: SHELLCHECK_OPTS: -x + typos: + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + submodules: true + - uses: crate-ci/typos@master + version-cmake-up-to-date: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, 'skip ci')" @@ -74,4 +84,3 @@ jobs: set -eux pwd [[ "$(cat ./rnp/version.txt)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; - diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 0000000000..78fce637b9 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,32 @@ +[default] +extend-ignore-identifiers-re = [ + ".*fpr.*", + ".*FPR.*", + ".*[0-9a-fA-F]{4,}", +] + +[default.extend-identifiers] +validate_desig_revokes = "validate_desig_revokes" +desig_rev = "desig_rev" +Nominet = "Nominet" +NOMINET = "NOMINET" +PNGs = "PNGs" +FOF = "FOF" +EDE3 = "EDE3" +ede3 = "ede3" +ffrom = "ffrom" +clen = "clen" +__THW_INTEL__ = "__THW_INTEL__" + +[default.extend-words] +MERCHANTIBILITY = "MERCHANTIBILITY" +FOF = "FOF" +FO = "FO" +claus = "claus" +desig = "desig" + +[files] +extend-exclude = [ + "src/tests/data/**", + "src/libsexpp/**" +] \ No newline at end of file