Repository navigation
feat(cli): implementar comandos scan, check e version com exit codes - #12
Merged
Merged
Conversation
Implementa a CLI com os subcomandos scan, check e version. Adiciona suporte a flags de configuracao e exit codes deterministicos. Closes #5
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.
Descrição
Implementa a interface de linha de comando (CLI) completa para o
envguardno entrypointcmd/envguarde módulointernal/cli, provendo os subcomandos essenciais do MVP (scan,check,version), suporte a flags de configuração (--path,--format,--severity,--no-color) e códigos de saída determinísticos para automação e pipelines de CI/CD.Closes #5
🛠️ Tipo de Alteração
feat: Nova funcionalidadefix: Correção de bugrefactor: Refatoração de código sem alteração no comportamentoperf: Melhoria de performancedocs: Alteração ou adição na documentaçãostyle: Formatação, linting, imports (sem mudança de lógica)test: Adição ou ajuste de testes automatizadoschore: Dependências, scripts ou configurações gerais📌 Alterações Realizadas
internal/cli/exitcodes.go):0: Sucesso / nenhum finding bloqueante detectado (ExitCodeSuccess).1: Finding(s) de severidade bloqueante encontrado(s) (ExitCodeFindingsFound).2: Erro de sintaxe, flags inválidas ou subcomando desconhecido (ExitCodeUsageError).3: Erro interno durante a execução (ExitCodeInternalError).internal/cli/version.go):envguard v0.1.0) e constanteVersion.envguard scan(internal/cli/scan.go):--path/-p,--format/-f(text,terminal,json),--severity/-s(info,warning,high,critical,all),--no-color.scanner.Scannerereporter.Reporter.envguard check(internal/cli/check.go):internal/cli/cli.go):cmd/envguard/main.go):cli.Runcomos.Exit(code).internal/cli/cli_test.go):🧪 Como Testar
envguard:./envguard version ./envguard --help ./envguard scan --format json ./envguard check --path . --severity highChecklist do Contribuinte (Pré-Envio)
git diffegit status..env), token ou arquivo temporário foi comitado.gofmt -s -w .e.editorconfig).go test ./...ego build ./...).