Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

Address code review findings: remove unreachable code and fix style issues#57

Merged
Morgy93 merged 2 commits intofix-code-scanningfrom
copilot/sub-pr-56
Jan 12, 2026
Merged

Address code review findings: remove unreachable code and fix style issues#57
Morgy93 merged 2 commits intofix-code-scanningfrom
copilot/sub-pr-56

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 12, 2026

Addresses four code review findings from PR #56: unreachable return statement, inconsistent comment indentation, and non-idiomatic module imports in tests.

Changes:

  • Remove unreachable code in ddev-utils.ts:218: The return result.stdout; statement was dead code—when result.status === 0, execution returns earlier via the allowedExitCodes check (line 203); when result.status !== 0, an error is thrown (line 215).

  • Fix comment indentation in ddev-utils.ts: Removed extra leading spaces from comments at lines 207 and 220 to align with surrounding code.

  • Modernize imports in ddev-utils.test.ts: Replaced require() calls for child_process and fs with ES6 imports, eliminating the need for runtime require statements in beforeEach.

// Before
beforeEach(() => {
    const cp = require('child_process');
    const fs = require('fs');
    spawnSyncStub = sandbox.stub(cp, 'spawnSync');
});

// After
import * as cp from 'child_process';
import * as fs from 'fs';

beforeEach(() => {
    spawnSyncStub = sandbox.stub(cp, 'spawnSync');
});

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…nd clean up imports

Co-authored-by: Morgy93 <7961978+Morgy93@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 12, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • update.code.visualstudio.com
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/vscode-ddev-phpstan/vscode-ddev-phpstan/node_modules/.bin/vscode-test (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Fix code scanning issues Address code review findings: remove unreachable code and fix style issues Jan 12, 2026
Copilot AI requested a review from Morgy93 January 12, 2026 13:20
@Morgy93 Morgy93 marked this pull request as ready for review January 12, 2026 13:22
@Morgy93 Morgy93 merged commit f7f59d2 into fix-code-scanning Jan 12, 2026
3 checks passed
@Morgy93 Morgy93 deleted the copilot/sub-pr-56 branch January 12, 2026 13:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants