chore(test): rename the Portuguese identifiers to English - #98
Merged
Conversation
`OMITIDOS_DE_PROPOSITO`, `_mede`, `_classificar`, `caminho`, `arquivos`, `ambos`, `nenhum`, `inesperados`, `esperado`, `nativo` — Portuguese names in an all-English codebase, from writing these tests while conversing in Portuguese. Copilot caught the ones in the open PR; these are the rest. Found by an AST sweep rather than by grepping words I remembered: every identifier in the project, diffed against the tree before this work started, which left 820 new names to review. Thirteen were Portuguese, all in this file. Comments, docstrings, and the non-Python files came back clean — the only accented text in the project is deliberate test data (`"olá"`, `"óólá"`, `"café"`), chosen because character count and byte count differ there. `caminho` → `path` collided with a loop variable already named `path` that held a `Path` while the renamed one held a `str`, so the glob variable is now `found`. That confusion predates the rename; it was just invisible while the two had different-language names. Verified the renamed tests still catch their mutants: dropping `mcp/*` from the library omit still fails `test_no_file_is_measured_by_both_jobs`.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #98 +/- ##
==========================================
+ Coverage 89.89% 89.92% +0.02%
==========================================
Files 41 41
Lines 3632 3632
==========================================
+ Hits 3265 3266 +1
+ Misses 367 366 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Copilot flagged four Portuguese variable names in #96. These are the rest — 13
identifiers in
tests/mcp_server/test_parsing.py, from the coverage-partitiontest, written while the session was being conducted in Portuguese.
OMITIDOS_DE_PROPOSITODELIBERATELY_UNMEASURED_mede_measures_classificar_classifycaminhopatharquivossourcesambos/nenhumboth/neitherinesperados/esperadounexpected/expectednativonativeHow they were found
Not by grepping words I remembered. An AST sweep collected every identifier in
the project, diffed against the tree as it stood before this work began, which
left 820 new names to review. Thirteen were Portuguese, all in one file.
Comments, docstrings and the non-Python files (
.md,.yml,.toml, thecoverage configs) came back clean. The only accented text in the project
is deliberate test data —
"olá","óólá","café","héllo","ção"—chosen precisely because character count and byte count differ there, which is
what those tests are about.
One thing the rename exposed
caminho→pathcollided with a loop variable already calledpath, whichheld a
Pathwhile the renamed one held astr. The glob variable is nowfound. That confusion predated the rename; having the two in differentlanguages had been hiding it.
Verification
The renamed tests still catch their mutants — dropping
mcp/*from thelibrary omit still fails
test_no_file_is_measured_by_both_jobs. 702 MCPtests, 91.3% coverage,
mypyandflake8clean.