Skip to content

Do not try to propose a fix when there is an uppercase in the middle of a word #314

Open

Description

@sylvestre

False positive as example: aParent => apparent
When there is an uppercase in the middle of the word, maybe codespell should not try to correct it.

Activity

  1. luzpaz commented on Jan 25, 2018

    @luzpaz
    Collaborator

    Yes, good idea. I think trying to flesh out the conditions for this is important.

  2. sylvestre commented on Jan 26, 2018

    @sylvestre
    ContributorAuthor

    What about ignoring like this?
    m = re.match(r'^[a-z][A-Z][a-z]*', typo)

  3. jankeromnes commented on Apr 20, 2018

    @jankeromnes
    Contributor

    m = re.match(r'^[a-z][A-Z][a-z]*', typo)

    I think this wouldn't catch variables like anInteger, itemCounter, annualGrowthRate, etc.

  4. peternewman commented on Apr 28, 2018

    @peternewman
    Collaborator

    What's the use case here? Personally if camel casing, I'd like to spell-check item and Counter and ensure they're valid words. Although if you're doing the style where you prepend the type of the variable (int, bool etc) e.g. iCounter, bProcessed, that probably falls down with some types as b won't be a valid word on it's own.

  5. mikedh commented on Oct 18, 2019

    @mikedh

    It also attempts to add a space in some cases which is somewhat undesirable and breaking in variable/class names:

    class FileTests(g.unittest.TestCase):
    	FileTests  ==> file tests (Y/n) 
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions