[Feature Request]: Support code dependency on a single expression with multiple assignments
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 65/100
Direzione di ricerca
Inizia dai punti di ingresso eval_code() e get_code() descritti nell’issue, quindi esegui i casi di testthat forniti per le assegnazioni concatenate. Implementa il supporto per <-, -> e per le catene di assegnazioni miste, in modo che ogni variabile assegnata restituisca l’espressione originale, e verifica che tutti e tre gli esempi abbiano esito positivo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Feature description
Such as var1 <- var2 <- 2
pkgload::load_all("../teal.code")
#> ℹ Loading teal.code
code <- "var1 <- var2 <- 1"
td <- eval_code(qenv(), code)
get_code(td, names = "var1")
#> [1] "var1 <- var2 <- 1"
get_code(td, names = "var2")
#> Warning: Object(s) not found in code: var2.
#> [1] ""
Created on 2025-04-30 with reprex v2.1.1
See test suite below for test-driven development
testthat::describe("detects multiple assignments in single line", {
testthat::it("<-", {
# testthat::skip("Not implemented")
code <- "var1 <- var2 <- 1"
td <- eval_code(qenv(), code)
testthat::expect_identical(get_code(td, names = "var1"), code)
testthat::expect_identical(get_code(td, names = "var2"), code)
})
testthat::it("->", {
code <- "1 -> var1 -> var2"
td <- eval_code(qenv(), code)
testthat::expect_identical(
get_code(td, names = "var1"),
as.character(parse(text = code, keep.source = TRUE))
)
testthat::expect_identical(get_code(td, names = "var1"), code)
testthat::expect_identical(get_code(td, names = "var2"), code)
})
testthat::it("<- and ->", {
code <- "var1 <- 1 -> var2"
td <- eval_code(qenv(), code)
testthat::expect_identical(get_code(td, names = "var1"), code)
testthat::expect_identical(get_code(td, names = "var2"), code)
})
})
Code of Conduct
- I agree to follow this project's Code of Conduct.
Contribution Guidelines
- I agree to follow this project's Contribution Guidelines.
Security Policy
- I agree to follow this project's Security Policy.
- Lingua principale
- R
- Stelle
- 12
- Fork
- 11
- Merge medio
- 8g 15h
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di insightsengineering/teal.code
-
Move to PharmaverseForse già presa @llrs-roche l’ha presa 39 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
insightsengineering/teal.code#292 ·
-
[Feature Request]: High cyclomatic complexity leds to bad readabilityForse già presa @llrs-roche l’ha presa 40 giorni fa. Apertaenhancement
Difficoltà 3/5 3-5 giorni Idoneità per principianti 45/100
insightsengineering/teal.code#295 ·
-
core discussion
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
insightsengineering/teal.code#291 · 2 commenti · 1 reazione ·
-
bug core
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
insightsengineering/teal.code#275 ·
-
bug core
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
insightsengineering/teal.code#272 ·
Tutte le issue di insightsengineering/teal.code
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
HelenaLC/spatialdataR#284 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 71/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Hackathon: Tier 1
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
pharmaverse/logrx#309 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno