pyproject.toml: a comment or `]` inside a pytest list drops entries
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 86/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
- Bereich
- testing
Rechercherichtung
Beginne in src/repo/adapters/python.ts bei readPytestSettings und splitList und lies dann den Fall some_function() in tests/repo/python-adapter.test.ts. Ergänze Tests für die drei TOML-Beispiele und eine mehrzeilige Liste mit nachgestelltem Komma; sorge dafür, dass bei unsicherer Eingabe settings.unreadable gesetzt wird. Führe npm test aus und bestätige, dass die Listenwerte erhalten bleiben und der Fallback für nicht lesbare Eingaben abgedeckt ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
readPytestSettings in src/repo/adapters/python.ts reads python_files, testpaths and pythonpath from [tool.pytest.ini_options] with a regex. The regex takes everything up to the first ], and splitList splits it on whitespace and commas. TOML comments and brackets inside strings both break this:
[tool.pytest.ini_options]
python_files = [
"test_*.py", # see [docs]
"check_*.py",
]
Today this returns ["test_*.py", "#", "see", "[docs"], which drops check_*.py. With the comment # unit instead, it returns ["test_*.py", "#", "unit", "check_*.py"]. testpaths = ["tests/[a]", "integration"] returns ["tests/[a"], which drops integration.
Done when:
- Comments outside strings are ignored, and a
]or,inside a quoted string stays part of the value. Splitting the list into quoted strings works better than splitting on whitespace. - Anything the reader can't parse with certainty sets
settings.unreadable, as a non-literal value already does (see thesome_function()case in the test). DiffCI then runs the full suite, which is safe. Never guess. tests/repo/python-adapter.test.tshas cases for the three examples above, plus a multi-line list with a trailing comma.
New to DiffCI? See CONTRIBUTING.md: add a synthetic fixture, run npm test, and sign off commits with git commit -s. Comment here to claim the issue.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 0
- Forks
- 4
- Ø Merge
- 18 Std. 41 Min.
- Gemergte PRs (30 T.)
- 48
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus DiffCI/core
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Planner: splitParts regex is quadratic on a quote followed by many backticks, so the fuzz test fails at randomEvtl. vergeben @FredApps hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
Maintainer antworten meist innerhalb von 1 Tag
-
Agent tools: changed_files lists only the new path of a renamed fileEvtl. vergeben @FredApps hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
DiffCI/core#243 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
adapter good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
agent-ready area: ui-server priority: p3 type: test
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
schlessera/brain-kit#4249 ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation tool triaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 73/100
can1357/oh-my-pi#19608 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
dependencies tech-debt
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
bcgov/nr-waste-plus#1549 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
blixvip/solana-token-meta#17 ·
-
enhancement good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
blixvip/solana-tx-parse#18 ·