lint: update list of spelling linter false positives, bump to codespell 2.0.0 #20817

pull theStack wants to merge 3 commits into bitcoin:master from theStack:201212-lint-update-spelling-false-positives changing 4 files +14 −16
  1. theStack commented at 12:46 pm on December 31, 2020: member

    This small patch updates the ignore list for the spelling linter script (which uses codespell), both removing false-positives that are not relevant anymore and adding new ones. As suggested by jonatack, whose last name is now also part of the list :). Also changed the linter script to not check the gitian keys file, as suggested by hebasto. The codespell version used is bumped to most recent version 2.0.0, which is more aware of some terms that were previously needed in the ignorelist for v1.17.1, see #20817 (comment).

    Running spelling linter on master branch (repeated findings in the same file are removed to keep the output short):

     0$ ./test/lint/lint-spelling.sh
     1contrib/gitian-keys/keys.txt:16: Atack ==> Attack
     2doc/developer-notes.md:1284: inout ==> input, in out
     3doc/psbt.md:122: Asend ==> Ascend, as end
     4src/bench/verify_script.cpp:27: Keypair ==> Key pair
     5src/blockencodings.h:30: Unser ==> Under, unset, unsure, user
     6src/compressor.h:65: Unser ==> Under, unset, unsure, user
     7src/core_read.cpp:131: presense ==> presence
     8src/index/disktxpos.h:21: blockIn ==> blocking
     9src/net_processing.h:67: anounce ==> announce
    10src/netaddress.h:486: compatiblity ==> compatibility
    11src/primitives/transaction.h:35: nIn ==> inn, min, bin, nine
    12src/qt/bitcoinunits.cpp:101: nIn ==> inn, min, bin, nine
    13src/rpc/blockchain.cpp:2150: nIn ==> inn, min, bin, nine
    14src/rpc/misc.cpp:198: nIn ==> inn, min, bin, nine
    15src/script/bitcoinconsensus.cpp:81: nIn ==> inn, min, bin, nine
    16src/script/bitcoinconsensus.h:63: nIn ==> inn, min, bin, nine
    17src/script/interpreter.cpp:1279: nIn ==> inn, min, bin, nine
    18src/script/interpreter.h:222: nIn ==> inn, min, bin, nine
    19src/script/sign.cpp:17: nIn ==> inn, min, bin, nine
    20src/script/sign.h:39: nIn ==> inn, min, bin, nine
    21src/serialize.h:181: Unser ==> Under, unset, unsure, user
    22src/signet.cpp:142: nIn ==> inn, min, bin, nine
    23src/test/base32_tests.cpp:17: fo ==> of, for
    24src/test/base64_tests.cpp:17: fo ==> of, for
    25src/test/script_tests.cpp:1509: nIn ==> inn, min, bin, nine
    26src/test/sighash_tests.cpp:27: nIn ==> inn, min, bin, nine
    27src/test/validation_tests.cpp:78: excercise ==> exercise
    28src/undo.h:36: Unser ==> Under, unset, unsure, user
    29src/validation.cpp:1403: nIn ==> inn, min, bin, nine
    30src/validation.h:255: nIn ==> inn, min, bin, nine
    31src/wallet/wallet.cpp:1532: nIn ==> inn, min, bin, nine
    32src/wallet/walletdb.cpp:429: Crypted ==> Encrypted
    33test/functional/feature_nulldummy.py:63: unnecssary ==> unnecessary
    34test/functional/wallet_encryption.py:81: crypted ==> encrypted
    35test/functional/wallet_upgradewallet.py:36: fpr ==> for, far, fps
    36^ Warning: codespell identified likely spelling errors. Any false positives? Add them to the list of ignored words in test/lint/lint-spelling.ignore-words.txt
    

    Running spelling linter on PR branch:

    0$ ./test/lint/lint-spelling.sh
    1src/core_read.cpp:131: presense ==> presence
    2src/net_processing.h:67: anounce ==> announce
    3src/netaddress.h:486: compatiblity ==> compatibility
    4src/test/validation_tests.cpp:78: excercise ==> exercise
    5src/wallet/walletdb.cpp:429: Crypted ==> Encrypted
    6test/functional/feature_nulldummy.py:63: unnecssary ==> unnecessary
    7test/functional/wallet_encryption.py:81: crypted ==> encrypted
    8^ Warning: codespell identified likely spelling errors. Any false positives? Add them to the list of ignored words in test/lint/lint-spelling.ignore-words.txt
    

    This list of remaining findings doesn’t contain false positives anymore – the typos are fixed in PR #20762. Happy new year! 🍾

  2. DrahtBot added the label Tests on Dec 31, 2020
  3. jonatack commented at 3:52 pm on December 31, 2020: member

    ACK 8b4e84dbcd2a08e8a6e658d7aa684705b4f0d974

    0$ test/lint/lint-spelling.sh 
    1src/core_read.cpp:131: presense ==> presence
    2src/net_processing.h:67: anounce ==> announce
    3src/netaddress.h:486: compatiblity ==> compatibility
    4src/test/validation_tests.cpp:78: excercise ==> exercise
    5src/wallet/walletdb.cpp:429: Crypted ==> Encrypted
    6test/functional/feature_nulldummy.py:63: unnecssary ==> unnecessary
    7test/functional/wallet_encryption.py:81: crypted ==> encrypted
    

    Well done, thanks.

  4. practicalswift commented at 3:58 pm on December 31, 2020: contributor

    ACK 8b4e84dbcd2a08e8a6e658d7aa684705b4f0d974

    Happy new year! 🍾

    Happy new year @theStack!

  5. in test/lint/lint-spelling.ignore-words.txt:10 in 8b4e84dbcd outdated
    14 hist
    15 ser
    16-unselect
    17-lowercased
    18+asend
    19+atack
    


    hebasto commented at 12:21 pm on January 1, 2021:
    Is ignoring the contrib/gitian-keys/keys.txt file a more reliable and future-proof solution?

    theStack commented at 7:44 pm on January 1, 2021:
    Agreed that it would be better to exclude files from the spelling linter that merely consists of names. Maybe a follow-up PR would be appropriate here, where not only the gitian keys file, but all other candidates are thoroughly identified and excluded?

    hebasto commented at 8:10 pm on January 1, 2021:

    Why a separate pr for a one-line change?

    0--- a/test/lint/lint-spelling.sh
    1+++ b/test/lint/lint-spelling.sh
    2@@ -15,6 +15,6 @@ if ! command -v codespell > /dev/null; then
    3 fi
    4 
    5 IGNORE_WORDS_FILE=test/lint/lint-spelling.ignore-words.txt
    6-if ! codespell --check-filenames --disable-colors --quiet-level=7 --ignore-words=${IGNORE_WORDS_FILE} $(git ls-files -- ":(exclude)build-aux/m4/" ":(exclude)contrib/seeds/*.txt" ":(exclude)depends/" ":(exclude)doc/release-notes/" ":(exclude)src/leveldb/" ":(exclude)src/crc32c/" ":(exclude)src/qt/locale/" ":(exclude)src/qt/*.qrc" ":(exclude)src/secp256k1/" ":(exclude)src/univalue/"); then
    7+if ! codespell --check-filenames --disable-colors --quiet-level=7 --ignore-words=${IGNORE_WORDS_FILE} $(git ls-files -- ":(exclude)build-aux/m4/" ":(exclude)contrib/seeds/*.txt" ":(exclude)depends/" ":(exclude)doc/release-notes/" ":(exclude)src/leveldb/" ":(exclude)src/crc32c/" ":(exclude)src/qt/locale/" ":(exclude)src/qt/*.qrc" ":(exclude)src/secp256k1/" ":(exclude)src/univalue/" ":(exclude)contrib/gitian-keys/keys.txt"); then
    8     echo "^ Warning: codespell identified likely spelling errors. Any false positives? Add them to the list of ignored words in ${IGNORE_WORDS_FILE}"
    9 fi
    

    theStack commented at 10:47 pm on January 1, 2021:

    I think this does strictly speaking more than the PR title suggests, but OTOH I don’t mind adding it. (Though, for this specific case, considering jonatacks high involvement and activity in the project, it’s quite likely that his last name will appear in some other file (e.g. in doc/) and it will have to end up in the spelling linter ignorelist again :))

    Anyways, added another commit. If it creates controversy for some reason, it can easily be removed from the PR without invalidating the previous ACKs.

  6. hebasto changes_requested
  7. hebasto commented at 12:21 pm on January 1, 2021: member
    Concept ACK.
  8. theStack commented at 10:57 pm on January 1, 2021: member
    Added a commit to ignore the gitian keys file for linting, as suggested by hebasto, and updated the PR description accordingly.
  9. hebasto commented at 11:02 pm on January 1, 2021: member

    Tested a63b712cad90f57cc9c7a8f0436c1e4ec7e77dc7:

     0$ codespell --version
     11.17.1
     2$ test/lint/lint-spelling.sh 
     3ci/lint/06_script.sh:29: keyserver ==> key server
     4contrib/macdeploy/gen-sdk:60: files' ==> file's
     5contrib/seeds/makeseeds.py:108: dedup ==> dedupe
     6contrib/seeds/makeseeds.py:189: dedup ==> dedupe
     7contrib/verify-commits/README.md:43: keyserver ==> key server
     8src/Makefile.am:278: OBJEXT ==> OBJECT
     9src/core_read.cpp:131: presense ==> presence
    10src/cuckoocache.h:152: copyable ==> copiable
    11src/net_processing.h:67: anounce ==> announce
    12src/netaddress.h:486: compatiblity ==> compatibility
    13src/support/lockedpool.h:55: copyable ==> copiable
    14src/support/lockedpool.h:166: copyable ==> copiable
    15src/test/validation_tests.cpp:78: excercise ==> exercise
    16src/wallet/walletdb.cpp:429: Crypted ==> Encrypted
    17src/zmq/zmqpublishnotifier.cpp:231: Dedup ==> Dedupe
    18test/functional/feature_nulldummy.py:63: unnecssary ==> unnecessary
    19test/functional/wallet_encryption.py:81: crypted ==> encrypted
    20^ Warning: codespell identified likely spelling errors. Any false positives? Add them to the list of ignored words in test/lint/lint-spelling.ignore-words.txt
    

    This list of remaining findings doesn’t contain false positives anymore – the typos are fixed in PR #20762.

    Not sure about that statement.

    From the Cirrus linter job log:

     0ci/lint/06_script.sh:29: keyserver ==> key server
     1contrib/macdeploy/gen-sdk:60: files' ==> file's
     2contrib/seeds/makeseeds.py:108: dedup ==> dedupe
     3contrib/seeds/makeseeds.py:189: dedup ==> dedupe
     4contrib/verify-commits/README.md:43: keyserver ==> key server
     5src/Makefile.am:278: OBJEXT ==> OBJECT
     6src/core_read.cpp:131: presense ==> presence
     7src/cuckoocache.h:152: copyable ==> copiable
     8src/net_processing.h:67: anounce ==> announce
     9src/netaddress.h:486: compatiblity ==> compatibility
    10src/support/lockedpool.h:55: copyable ==> copiable
    11src/support/lockedpool.h:166: copyable ==> copiable
    12src/test/validation_tests.cpp:78: excercise ==> exercise
    13src/wallet/walletdb.cpp:429: Crypted ==> Encrypted
    14src/zmq/zmqpublishnotifier.cpp:231: Dedup ==> Dedupe
    15test/functional/feature_nulldummy.py:63: unnecssary ==> unnecessary
    16test/functional/wallet_encryption.py:81: crypted ==> encrypted
    17^ Warning: codespell identified likely spelling errors. Any false positives? Add them to the list of ignored words in test/lint/lint-spelling.ignore-words.txt
    
  10. DrahtBot commented at 2:03 am on January 2, 2021: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    No conflicts as of last run.

  11. theStack commented at 4:12 am on January 2, 2021: member
    @hebasto: Thanks for testing! I wasn’t aware that I used already codespell 2.0.0 (recently released in 23 Nov 2020), which is obviously more aware of various terms like e.g. objext as Makefile term and copyable as C++ term (see their commit https://github.com/codespell-project/codespell/commit/45b67b427489910b0ef5e4566c9b3989be3f0f33 which fixed this). Could either bump the codespell version from 1.17.1 to 2.0.0 in an additional (first) commit or simply restore the removed exceptions for objext, copyable, keyserver (and add dedup) from the false positives wordlist change.
  12. hebasto commented at 6:21 am on January 2, 2021: member

    Could either bump the codespell version from 1.17.1 to 2.0.0 in an additional (first) commit or simply restore the removed exceptions for objext, copyable, keyserver (and add dedup) from the false positives wordlist change.

    I think the former is fine. The only concern is about https://github.com/codespell-project/codespell/issues/1774.

  13. theStack renamed this:
    lint: update list of spelling linter false positives
    lint: update list of spelling linter false positives, bump to codespell 2.0.0
    on Jan 2, 2021
  14. theStack force-pushed on Jan 2, 2021
  15. test: bump codespell linter version to 2.0.0 a0022f1cfb
  16. theStack force-pushed on Jan 2, 2021
  17. in test/lint/lint-spelling.ignore-words.txt:13 in 852cd43b3e outdated
    20+fo
    21+fpr
    22+inout
    23+keypair
    24+nin
    25+unser
    


    hebasto commented at 11:50 am on January 2, 2021:
    nit: The sorting mode of the whole file should be lexicographical or “natural” (i.e., as reported by the linter, that is lexicographical for containing file paths), but not a mix of both.

    theStack commented at 6:09 pm on January 2, 2021:
    Thanks, I decided for the lexicographical order as I think it’s easier to read and maintain. Done.
  18. in test/lint/lint-spelling.ignore-words.txt:14 in 852cd43b3e outdated
    18+asend
    19+blockin
    20+fo
    21+fpr
    22+inout
    23+keypair
    


    hebasto commented at 11:53 am on January 2, 2021:

    theStack commented at 6:10 pm on January 2, 2021:
    Agreed, done.
  19. hebasto approved
  20. hebasto commented at 11:53 am on January 2, 2021: member
    ACK 852cd43b3e22d84aa44ec6aa42b24dd3cf5c6c01, tested on Linux Mint 20 (x86_64).
  21. lint: update list of spelling linter false positives da289a6c4a
  22. lint: ignore gitian keys file for spelling linter
    Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
    f3ba916e8b
  23. theStack force-pushed on Jan 2, 2021
  24. theStack commented at 6:11 pm on January 2, 2021: member
    Force-pushed, addressed @hebasto’s suggestions of keeping the ignore-list in order (https://github.com/bitcoin/bitcoin/pull/20817#discussion_r550874221) and removing the “keypair” exception (https://github.com/bitcoin/bitcoin/pull/20817#discussion_r550874370).
  25. hebasto approved
  26. hebasto commented at 6:42 pm on January 2, 2021: member
    re-ACK f3ba916e8b5b5ee2a381cef38882671eadb231df, only suggested changes since my previous review.
  27. jonatack commented at 8:05 pm on January 2, 2021: member
    ACK f3ba916e8b5b5ee2a381cef38882671eadb231df I don’t know if there are any particular issues with bumping codespell to v2.0.0, but locally running the spelling linter and the cirrus job at https://cirrus-ci.com/task/5004066998714368 both LGTM. Thanks for also verifying and removing the unused words from the ignore list.
  28. fanquake merged this on Jan 4, 2021
  29. fanquake closed this on Jan 4, 2021

  30. sidhujag referenced this in commit 73bd04f8c1 on Jan 4, 2021
  31. DrahtBot locked this on Aug 16, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me