Skip to content

Add conservative identifier readability check - #74

Merged
rxdt merged 5 commits into
rxdt:mainfrom
MrC8559:feature/plain-identifier-names
Sep 18, 2026
Merged

rxdt merged 5 commits into
rxdt:mainfrom
MrC8559:feature/plain-identifier-names

Conversation

@MrC8559

@MrC8559 MrC8559 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the names/identifiers half of #61 with a deliberately conservative AST check.

  • splits snake_case and CamelCase declaration names into tokens;
  • checks function, async-function, and class names only;
  • flags clearly compressed vowel-stripped tokens such as chk / cfg;
  • flags multiple short consonant-only tokens such as fp_sz;
  • preserves common technical initialisms and unknown all-uppercase acronym chunks;
  • treats y as a vowel to reduce false positives such as sync;
  • registers the check in the existing CHECKS registry.

The heuristic intentionally prefers false negatives over false positives. It is not a dictionary, general English checker, or claim of standards conformance.

Tests

Added focused coverage for:

  • snake_case / CamelCase / acronym tokenization;
  • clear compressed-name positives;
  • functions, async functions, and classes;
  • common technical initialisms, digits, acronym chunks, and readable-name negatives;
  • non-declaration AST nodes;
  • registry wiring.

Validation

Final upstream gate run #201 passed completely on commit e148ff86a39306789c14ce953549f01a947bf4bc:

  • Ubuntu gate: passed
  • macOS gate: passed
  • Windows gate: passed
  • dependency review: passed

The gate includes the repository's audit, security, pytest/100%-coverage, Pyright, Ruff format/lint, Pylint, and complexity checks. Earlier CI feedback was used to remove regex, satisfy the repository's docstring/style rules, simplify the tokenizer below the complexity cap, and restore full coverage/format compliance.

Scope

This does not touch the Vale/prose half of #61.

@MrC8559
MrC8559 marked this pull request as ready for review September 17, 2026 11:05
@rxdt
rxdt merged commit 9360843 into rxdt:main Sep 18, 2026
4 checks passed

rxdt commented Sep 18, 2026

Copy link
Copy Markdown
Owner

MrC8559, thank you for this. You took on a hard part of the issue and kept it practical. The rule is clear, and the tests make its limits easy to see. I appreciate the care you put into it.

@MrC8559

MrC8559 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

Thanks!
Glad I could help.

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.

2 participants