구성 린트
구성 린트 (kongctl lint)
kongctl lint는 선언형 구성 파일을 규칙 세트(ruleset) 기준으로 검사하는 린트 명령어예요. 파일 하나, 디렉터리 전체, stdin 입력 등 다양한 방식으로 검사 대상을 지정할 수 있고, --fail-severity 옵션으로 어느 심각도부터 실패 종료 코드를 반환할지 조절할 수 있어요. 검사 결과는 기본 표 형식 외에 JSON 같은 출력 형식으로도 확인할 수 있어요
출처: 문서
본문
명령어 사용법
Usage:
kongctl lint [flags]
Aliases:
lint, li
Examples:
# Lint a single file
kongctl lint -f config.yaml -r ruleset.yaml
# Lint all YAML files in a directory
kongctl lint -f ./configs/ -r ruleset.yaml
# Lint recursively with JSON output
kongctl lint -f ./configs/ -R -r ruleset.yaml --output json
# Only show errors (not warnings/info/hints)
kongctl lint -f config.yaml -r ruleset.yaml --fail-severity error -D
# Fail on warnings and above
kongctl lint -f config.yaml -r ruleset.yaml --fail-severity warn
# Read from stdin
cat config.yaml | kongctl lint -f - -r ruleset.yaml
Flags:
--color-theme string Configures the CLI UI/theme (prompt, tables, TUI elements).
- Config path: [ color-theme ]
- Examples : [ auto, 3024_day, 3024_night, aardvark_blue, abernathy ]
- Reference : [ https://github.com/lrstanley/bubbletint/blob/master/DEFAULT_TINTS.md ] (default "auto")
--config-file string Path to the configuration file to load.
- Environment variable: KONGCTL_CONFIG_FILE (overridden by this flag)
- Default: [ $XDG_CONFIG_HOME/kongctl/config.yaml ]
-D, --display-only-failures Only output results with severity equal to or greater than --fail-severity
-F, --fail-severity string Results of this severity or above will trigger a failure exit code. Allowed: [ error | warn | info | hint ] (default "error")
-f, --filename strings Input file(s) or directory to lint. Use '-' to read from stdin.
-h, --help help for lint
--log-file string Write execution logs to the specified file instead of STDERR.
- Config path: [ log-file ]
--log-level string Configures the logging level. Execution logs are written to STDERR.
- Config path: [ log-level ]
- Allowed : [ trace|debug|info|warn|error ] (default "error")
--no-telemetry Disable telemetry for this command invocation. Overrides config and env.
- Config path: [ telemetry.enabled ]
- Env var : [ KONGCTL_NO_TELEMETRY ]
- Default : [ false ]
--no-trunc Preserve full cell widths in static text tables beyond terminal width.
Does not change column selection, UUID formatting, or explicit string slices.
- Config path: [ text.no-trunc ]
- Default : [ false ]
-o, --output string Configures the format of data written to STDOUT.
- Config path: [ output ]
- Allowed : [ json|yaml|text ] (default "text")
-p, --profile string Specify the profile to use for this command. (default "default")
-R, --recursive Process the directory used in -f, --filename recursively
-r, --ruleset string Path to a Spectral-compatible linting ruleset file (YAML or JSON)
--text-id-format string Configure UUID rendering in static text-table ID columns.
- Config path: [ text.id-format ]
- Allowed : [ compact|full ]
- Default : [ compact ]
--text-layout string Configure static text-table column selection.
- Config path: [ text.layout ]
- Allowed : [ compact|auto|wide ]
- Default : [ compact ]
관련 리소스
더 알아보기 (Learn more)
- kongctl의 선언형 구성 개념을 먼저 이해하면 린트로 검사하는 파일의 구조를 더 잘 파악할 수 있어요 — Declarative configuration with kongctl
- kongctl을 처음 접한다면 기본 사용법부터 익히고 이 명령어를 활용해 보세요 — Get started with kongctl