Fix remaining SonarCloud findings - #1823
Merged
Merged
Conversation
- Remove nested template literals in docker env var escaping - Fix Promise.any receiving non-Promise values (filter before map) - Replace regex patterns with string literals in parser-includes - Replace deprecated tseslint.config() with flat array export
- Remove nested template literals in docker env var escaping (S4624) - Fix Promise.any receiving non-Promise values (S4123) - Replace regex patterns with string literals in parser-includes (S7781) - Replace deprecated tseslint.config() with flat array export (S1874) - Fix eslint ignore pattern for .gitlab-ci-local directories
- Use node: prefixed imports for assert and path across all source files - Replace String#replace with String#replaceAll where appropriate - Use String.raw for backslash escaping - Use Array.isArray() instead of instanceof Array - Use .at(-1) instead of [length - 1] - Use new Error() instead of Error() - Flip negated conditions - Compare with undefined directly instead of typeof - Combine multiple Array#push calls into single calls - Inline Promise.all arrays instead of separate push calls
Contributor
There was a problem hiding this comment.
1 issue found across 14 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/variables-from-files.ts">
<violation number="1" location="src/variables-from-files.ts:75">
P2: Escape regex metacharacters in `matcher` before converting `*` to `.*`; current construction can mis-match scopes or throw on invalid patterns.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| assert(typeof content == "string", `${key}.${matcher} content must be text or multiline text`); | ||
| if (isDotEnv || type === "variable" || (type === null && !/^[/~]/.exec(content))) { | ||
| const regexp = matcher === "*" ? /.*/g : new RegExp(`^${matcher.replace(/\*/g, ".*")}$`, "g"); | ||
| const regexp = matcher === "*" ? /.*/g : new RegExp(`^${matcher.replaceAll("*", ".*")}$`, "g"); |
Contributor
There was a problem hiding this comment.
P2: Escape regex metacharacters in matcher before converting * to .*; current construction can mis-match scopes or throw on invalid patterns.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/variables-from-files.ts, line 75:
<comment>Escape regex metacharacters in `matcher` before converting `*` to `.*`; current construction can mis-match scopes or throw on invalid patterns.</comment>
<file context>
@@ -72,20 +72,20 @@ export class VariablesFromFiles {
assert(typeof content == "string", `${key}.${matcher} content must be text or multiline text`);
if (isDotEnv || type === "variable" || (type === null && !/^[/~]/.exec(content))) {
- const regexp = matcher === "*" ? /.*/g : new RegExp(`^${matcher.replace(/\*/g, ".*")}$`, "g");
+ const regexp = matcher === "*" ? /.*/g : new RegExp(`^${matcher.replaceAll("*", ".*")}$`, "g");
variables[key] = variables[key] ?? {type: "variable", environments: []};
variables[key].environments.push({content, regexp, regexpPriority: matcher.length, scopePriority});
</file context>
Extract String.raw expressions into variables to avoid nested template literals while still satisfying the String.raw rule.
|
kevingerman
pushed a commit
to kevingerman/gitlab-ci-local
that referenced
this pull request
Apr 10, 2026
tmeijn
pushed a commit
to tmeijn/dotfiles
that referenced
this pull request
May 7, 2026
This MR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Adoption](https://docs.renovatebot.com/merge-confidence/) | [Passing](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---|---|---| | [npm:gitlab-ci-local](https://github.com/firecow/gitlab-ci-local) | `4.70.1` → `4.71.0` |  |  |  |  | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>firecow/gitlab-ci-local (npm:gitlab-ci-local)</summary> ### [`v4.71.0`](https://github.com/firecow/gitlab-ci-local/releases/tag/4.71.0) [Compare Source](firecow/gitlab-ci-local@4.70.1...4.71.0) #### What's Changed - Fix remaining SonarCloud findings by [@​firecow](https://github.com/firecow) in [#​1823](firecow/gitlab-ci-local#1823) - fix(windows): skip id -u on Windows to avoid confusing startup error by [@​bcouetil](https://github.com/bcouetil) in [#​1824](firecow/gitlab-ci-local#1824) - fix: --completion outputs wrong script name when run via Bun by [@​Paul-Goulpie](https://github.com/Paul-Goulpie) in [#​1826](firecow/gitlab-ci-local#1826) - feat: improve --list-csv and --list output by [@​bcouetil](https://github.com/bcouetil) in [#​1810](firecow/gitlab-ci-local#1810) - chore(deps): update all non-major by [@​renovate](https://github.com/renovate)\[bot] in [#​1830](firecow/gitlab-ci-local#1830) - chore(deps): lock file maintenance by [@​renovate](https://github.com/renovate)\[bot] in [#​1827](firecow/gitlab-ci-local#1827) - fix(deps): update dependency re2js to v2 by [@​renovate](https://github.com/renovate)\[bot] in [#​1828](firecow/gitlab-ci-local#1828) #### New Contributors - [@​Paul-Goulpie](https://github.com/Paul-Goulpie) made their first contribution in [#​1826](firecow/gitlab-ci-local#1826) **Full Changelog**: <firecow/gitlab-ci-local@4.70.1...4.71.0> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMzkuMSIsInVwZGF0ZWRJblZlciI6IjQzLjE0MC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6bWlub3IiXX0=-->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Uh oh!
There was an error while loading. Please reload this page.