Skip to content

feat(config): add OCO_EMOJI_FULL_SPEC config option - #598

Merged
di-sukharev merged 2 commits into
di-sukharev:masterfrom
brianrobt:feat/fgm-config-setting
Nov 13, 2026
Merged

di-sukharev merged 2 commits into
di-sukharev:masterfrom
brianrobt:feat/fgm-config-setting

Conversation

@brianrobt

Copy link
Copy Markdown
Contributor

Fixes #537

Problem

--fgm was only a CLI flag, so anyone who always wants the full GitMoji spec had to pass it on every run. The prepare-commit-msg hook never passes the flag, so hook users couldn't get the full spec at all.

Changes

Adds a boolean OCO_EMOJI_FULL_SPEC config key (default false) that does the same thing as --fgm. It works with oco config set, .env and oco config describe, and it's named to sort with OCO_EMOJI and OCO_EMOJI_POSITION_BEFORE_DESCRIPTION.

The setting is read in getMainCommitPrompt next to OCO_EMOJI, so the CLI, the hook and the @commitlint prompt path all pick it up. README is updated.

One thing to note: with the setting on, --fgm=false doesn't turn it off, since the flag defaults to false (from #472). OCO_EMOJI_FULL_SPEC=false oco works for a one-off. I can follow up on the flag if you'd like that changed.

Tests

Tested with:

  • npm run test:unit (214 passing, new cases in config.test.ts and prompts.test.ts)
  • npm run lint and npm run format:check
  • test/e2e/cliBehavior.test.ts (24 passing, with a new test that runs the built CLI with only the setting)
  • oco config set / oco config describe by hand, including an invalid value being rejected

I didn't run the other e2e suites, and the hook path is covered by the unit tests only.

brianrobt and others added 2 commits November 11, 2026 14:15
Introduce a new `OCO_EMOJI_FULL_SPEC` boolean config key that mirrors
the behaviour of the `--fgm` CLI flag but persists across runs. This
allows users to enable the full GitMoji specification once via
`oco config set OCO_EMOJI_FULL_SPEC=true` instead of passing `--fgm`
on every invocation. The setting also applies to commits generated
by the `prepare-commit-msg` git hook, which does not accept flags.

Changes include:
- Add `OCO_EMOJI_FULL_SPEC` to `CONFIG_KEYS` enum, `ConfigType`,
 `DEFAULT_CONFIG`, env config reader, validator and key details
- Update `getMainCommitPrompt` to combine the flag and the new
 setting when deciding whether to use the full spec
- Document the new config key in README alongside existing options
- Add e2e and unit tests covering the new setting
@di-sukharev
di-sukharev merged commit b8f6c5b into di-sukharev:master Nov 13, 2026
5 checks passed
@brianrobt
brianrobt deleted the feat/fgm-config-setting branch November 13, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: make --fgm a setting

2 participants