Skip to content

Fix incorrect lloc count when there's a colon in the line (fixes #262)#263

Open
devdanzin wants to merge 1 commit intorubik:masterfrom
devdanzin:fix_lloc_colon
Open

Fix incorrect lloc count when there's a colon in the line (fixes #262)#263
devdanzin wants to merge 1 commit intorubik:masterfrom
devdanzin:fix_lloc_colon

Conversation

@devdanzin
Copy link
Contributor

This PR makes raw._logical avoid counting lines with colons as two logical lines unless a compound statement keyword is present.

There's still an issue, because "match" and "case" are soft keywords, so _logical will still count 2 llocs on a line like:

case = {1: 2, 3: 4}

However, this change makes the count right for the common cases and wrong only for questionable (as in "using soft keywords as variable names") code.

Fixes #262.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect lloc count

1 participant