Enhancement: scan Terraform / OpenTofu JSON configs (`.tf.json`, `.tofu.json`)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
Línea de trabajo
Start with isTerraformManifest and extractTerraformRequirements in src/core-open/scanners/terraform-scanner.ts, then read parseHclBlocks in src/core-open/scanners/hcl-blocks.ts and the precedence tests in test/terraform-scanner.test.ts. Add coverage for JSON manifest detection, declarations, HCL and JSON conflicts, OpenTofu shadowing, and invalid JSON; use the existing module source classifier. Done means the acceptance cases pass and the selected precedence and invalid JSON behavior are documented in DOCS.md.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
- Difficulty: medium
- Area: Terraform scanner
Problem
isTerraformManifest in src/core-open/scanners/terraform-scanner.ts (around lines 383–384) only accepts .tf and .tofu. test/terraform-scanner.test.ts (around line 154) pins isTerraformManifest('main.tf.json') to false. Terraform’s official JSON syntax (*.tf.json) and OpenTofu’s *.tofu.json are therefore never parsed.
extractTerraformRequirements walks HCL via parseHclBlocks (src/core-open/scanners/hcl-blocks.ts). JSON configs need a different walk of the same shapes: terraform.required_version, terraform.required_providers, provider blocks, and module blocks with source / version.
A directory that contains only versions.tf.json is not even a project. A mixed directory silently omits providers and modules declared only in the JSON files.
Expected behaviour
Treat .tf.json and .tofu.json as Terraform manifests. Apply the same OpenTofu shadowing rule already documented for .tofu vs .tf (a same-stem .tofu.json replaces .tf.json / .tf as appropriate — pin the exact precedence in the test and a short DOCS.md note). Parse JSON objects for required_version, required_providers (including the legacy version-only shorthand), standalone provider version pins, and registry module sources. Reuse classifyTerraformModuleSource so git / local / S3 sources stay non-registry. Invalid JSON fails that file in an actionable way or is skipped without a stack trace; pin one behaviour and document it. HCL files stay on the existing parser.
Acceptance
isTerraformManifest('versions.tf.json')andisTerraformManifest('versions.tofu.json')are true;readme.mdis still false.- A project with only
versions.tf.jsondeclaring a provider and a registry module reports them (offline scan is enough for declaration). - A same-directory HCL + JSON combination does not double-count the same provider source; pin how a conflict is resolved.
- Existing
.tf/.tofutests keep passing, including the OpenTofu stem-shadowing cases intest/terraform-scanner.test.ts.
- Lenguaje dominante
- TypeScript
- Estrellas
- 4
- Forks
- 3
- Merge medio
- 1 d 22 h
- PR fusionados (30 d)
- 76
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de vibgrate/cli
-
documentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
Todos los issues de vibgrate/cli
Issues similares
-
documentation Entwickler
Dificultad 1/5 Menos de una hora Aptitud para principiantes 89/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
area:frontend bug ci-test level:low priority:high
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
skytuhua-org/Gen-V1#2974 · 4 comentarios ·
Los mantenedores suelen responder en 2 días
-
area: cli area: core priority: P3 type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
appandflow/stim#6736 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
naomiaro/waveform-playlist#973 ·
Los mantenedores suelen responder en 1 día