Skip to content

Add more words to the CSpell dictionary to avoid false positives. #6047

@avpaderno

Description

@avpaderno

Looking at the failing tests for a PR I created, I noticed that CSpell reports words that should not report, such has:

  • core/includes/bootstrap.inc:1898:21 (funcs)
    * @section sec_alt_funcs_install Use During Installation Phase
    funcs is part of a section identifier and it is fine as it is. We are certainly not going to change sec_alt_funcs_install to sec_alt_functions_install.
  • core/includes/bootstrap.inc:3357:6 (HMAC)
    * HMAC and timestamp.
    HMAC is a correct acronym. The reports about hmac are indeed correct (when hmac is not part of a function name, a variable name, or other identifiers), since it should be spelled HMAC.
  • core/includes/evalmath.inc:45:9 (funcs)
    $m->funcs()
    That is code and func() is a method. Since that is a file that comes from an external source, it is probably better to set CSpell to ignore that file.
  • core/includes/mail.inc:454:13 Unknown word (tagname)
    list($tagname) = explode(' ', strtolower($value), 2);
    That is a variable name. I guess that $tag_name would not be reported.
  • core/modules/file/file.field.inc:851:23 (hmac)
    $token = backdrop_hmac_base64($new_path,
    That is part of a function name. We are not going to change the function name to backdrop_HMAC_base64().

I understand that we want variable names to be reported, to discover code that is setting/initializing a variable that is never used again in that function/method. I also understand we want to discover lines that call a method/function that does not exist simply because the method/function name is not the correct one.
(Probably there are better tools for those cases, though.)

Still, CSpell should be set to avoid checking what follows PHPDoc tags, recognize more acronyms that are usually used in programming, and avoid all those files that we copy from an external source and for which being able to apply them a patch is more important than editing the files to fix a variable/function/method name or a comment.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions