Skip to content

Improve getKeys script to ignore comments and trim keys#2120

Merged
GeorgeNgMsft merged 4 commits intomainfrom
dev/georgeng/getkeys_ignore_comments
Apr 2, 2026
Merged

Improve getKeys script to ignore comments and trim keys#2120
GeorgeNgMsft merged 4 commits intomainfrom
dev/georgeng/getkeys_ignore_comments

Conversation

@GeorgeNgMsft
Copy link
Copy Markdown
Contributor

@GeorgeNgMsft GeorgeNgMsft commented Apr 2, 2026

Adding a filter to ignore comments when running getKeys.readDotenv and handle scenarios such as using "#-------------------" for a page break.

For example :
image

Also added some minor k/v trimming + CRLF handling

@GeorgeNgMsft
Copy link
Copy Markdown
Contributor Author

@GeorgeNgMsft please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree company="Microsoft"

@GeorgeNgMsft GeorgeNgMsft added this pull request to the merge queue Apr 2, 2026
@GeorgeNgMsft GeorgeNgMsft removed this pull request from the merge queue due to a manual request Apr 2, 2026
@TalZaccai TalZaccai requested a review from Copilot April 2, 2026 05:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the getKeys developer script’s .env parsing to avoid treating comment/blank lines as key/value entries, improving compatibility with .env files that include separators like #-------------------.

Changes:

  • Filter out empty lines and full-line # comments when reading .env in readDotenv().
  • Keep the existing key/value splitting logic for non-comment lines.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GeorgeNgMsft GeorgeNgMsft deployed to development-fork April 2, 2026 17:42 — with GitHub Actions Active
@GeorgeNgMsft GeorgeNgMsft changed the title Improve getKeys script to ignore comments when reading .env Improve getKeys script to ignore comments and trim keys Apr 2, 2026
@GeorgeNgMsft GeorgeNgMsft added this pull request to the merge queue Apr 2, 2026
Merged via the queue into main with commit 550fd26 Apr 2, 2026
21 checks passed
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.

3 participants