Repository navigation
feat(cli): add --locale and deprecate --lang ko|en - #68
Conversation
Add a --locale <ko|en> flag that selects the output language. Docs and READMEs now use --locale. --lang ko|en still sets the locale for now but prints a deprecation warning, and this transition lasts one minor release. Any other --lang value, or an unknown --locale value, exits 1 with an error instead of being silently ignored. This keeps the planned programming-language meaning of --lang from ever applying silently. Refs #65
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 31 |
| Duplication | 2 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Code Review
This pull request replaces the --lang flag with --locale for setting the CLI locale, while maintaining backward compatibility for --lang with a deprecation warning. It introduces a robust resolveLocaleFlags utility to handle locale configuration, adds validation for locale values, and updates documentation and tests accordingly. I have no feedback to provide.
There was a problem hiding this comment.
All reported issues were addressed across 9 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
[Medium impact] The changes appear safe to merge. SummaryAdds
Reviews (2) · Last reviewed commit: "chore(cli): apply AI code review suggest..." · Reviewed by Greptile |
- Warn that --lang is ignored, not that it is the migration target, when --locale overrides it - Fix the Korean particles in the --lang deprecation message - Describe the current --lang/--locale error behavior and precedence in docs Refs #65
Deploying code-style with
|
| Latest commit: |
7fd6040
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6fbad627.code-style.pages.dev |
| Branch Preview URL: | https://amondnet-65-locale-flag.code-style.pages.dev |
|



Summary
Adds a global
--locale <ko|en>flag for the output language and starts retiring--lang ko|en.--langis reserved for a future programming-language selection, so its old meaning must not keep working silently. Previously a non-strictparseArgsignored unknown values and fell back to$LANG.--locale <ko|en>is a global flag (packages/cli/src/index.ts,resolveLocaleFlagsinsrc/i18n.ts).checkaccepts it too (src/check/run-check.ts).--lang ko|enstill sets the locale but prints a deprecation warning that points at--locale, for one minor release.--localewins when both are given.--langvalue,--langwithout a value, or an unknown--localevalue exits 1 with an error.packages/cli/README.md,README.ko.md, andapps/docscli.mdx(en/ko) use--localeand describe the transition.Scope and notes for reviewers
--lang ko|enfallback after one minor release is not tracked yet.package.jsonmode from feat(cli): detect languages, run without package.json, and split rules into rules/<lang>.md #65 remain, henceRefsrather than a closing keyword.Verification
bun testinpackages/cli: 261 pass / 1 skip / 0 fail. New: 5 unit tests forresolveLocaleFlags(test/i18n.test.ts) and 3 subprocess tests (test/index.test.ts).tsc --noEmitand eslint clean; docsastro buildandlint:docsclean (22 files).--lang ko|en|foo, bare--lang,--locale ko|fr,--locale en --lang ko,check --locale ko.Related issue
Refs #65
Checklist
bun run build)bun run lint)BREAKING CHANGE:note is includedSummary by cubic
Adds a global
--locale <ko|en>flag to select the CLI output language and deprecates--lang ko|en.--langis reserved for future programming-language selection, so unknown values that were previously ignored now fail instead of silently falling back to$LANG. The migration path is documented in both locales' READMEs and docs.Migration
--lang ko|enstill sets the locale for one minor release and prints a deprecation warning pointing at--locale.--localewins when both flags are given;--langthen prints an "ignored" warning telling the user to remove it, so it is not mistaken for the migration target.--langvalue, a bare--lang, or an unknown--localevalue exits 1.Written for commit 7fd6040. Summary will update on new commits.
Demo