Skip to content

feat: add isEnv() alias for forEnv() - #1260

Closed
Chams99 wants to merge 1 commit into
dmno-dev:mainfrom
Chams99:feat/is-env-alias
Closed

Chams99 wants to merge 1 commit into
dmno-dev:mainfrom
Chams99:feat/is-env-alias

Conversation

@Chams99

@Chams99 Chams99 commented Oct 29, 2026

Copy link
Copy Markdown

Closes #1248

Adds isEnv() as an alias of forEnv(), so boolean expressions like not(isEnv(production)) read more naturally. Same arguments and behavior as forEnv().

Includes a test, a note on the forEnv() docs page, and the VS Code autocomplete entry.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes Reviewed the runtime alias, regression coverage, documentation, and VS Code integration. The Varlock build, 189 unit tests, and extension grammar and snapshot checks passed.

  • Runtime alias: Registers isEnv() using the existing forEnv() definition, preserving argument validation, boolean inference, and environment matching.
  • Regression coverage: Tests nonmatching and multiple-environment conditions, plus the requested not(isEnv(...)) expression.
  • Editor and documentation: Adds resolver and boolean decorator completions, documents the alias, and includes release entries for both affected packages.

Pullfrog  | View workflow run | Using gpt-6.1-sol | 𝕏

@theoephraim

Copy link
Copy Markdown
Member

I'm torn... isEnv reads slightly better in some cases, but I'm not sure forEnv is really that bad?
Not sure if it's worth having 2 ways to do it.

@Chams99

Chams99 commented Oct 30, 2026

Copy link
Copy Markdown
Author

Yeah it's a small one. Where it helps is the negated case. not(isEnv(production)) reads more like an actual condition than not(forEnv(production)). If you'd rather keep a single way to do it no worries and I can close it.

@theoephraim

Copy link
Copy Markdown
Member

Thanks again for the PR, but yeah I think for the sake of simplicity, gonna just keep it as is.

@theoephraim theoephraim closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] isEnv alias for forEnv

2 participants