Skip to content

Commit 06d1620

Browse files
[AB#557] style: Apply automated formatting
- Format markdown sections with proper spacing - Align test struct fields - Clean up whitespace in exec.go
1 parent 9e5fc8f commit 06d1620

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

.github/copilot-instructions.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ Before submitting a PR:
320320
**For developers who want to test against Windows/other platforms locally**, you can use [nektos/act](https://github.com/nektos/act) to run GitHub Actions workflows on your machine:
321321

322322
**Installation**:
323+
323324
```bash
324325
# macOS
325326
brew install act
@@ -332,6 +333,7 @@ choco install act-cli
332333
```
333334

334335
**Usage**:
336+
335337
```bash
336338
# Run all CI tests (includes Windows)
337339
act
@@ -346,12 +348,14 @@ act --platform ubuntu-latest=catthehacker/ubuntu:act-latest
346348
act --dryrun
347349
```
348350

349-
**Note**:
351+
**Note**:
352+
350353
- Windows containers require Docker Desktop with Windows containers enabled
351354
- For Windows-specific tests, you may need larger runners: `act -P windows-latest=-self-hosted`
352355
- CI will always run full cross-platform tests automatically when you push
353356

354357
**When to use local cross-platform testing**:
358+
355359
- ✅ Testing platform-specific code (Windows batch files, Unix shell scripts, path handling)
356360
- ✅ Verifying OS-specific features (environment variables, file permissions, executables)
357361
- ✅ Testing changes to shims, install scripts, or platform detection

cmd/shims/exec.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ func prependToPath(env []string, dir string) []string {
428428
if idx, actualKey := findEnvVar(env, "PATH"); idx != -1 {
429429
// Found PATH, extract current value and prepend new directory
430430
currentPath := env[idx][len(actualKey)+1:] // +1 for the "=" sign
431-
431+
432432
// Detect separator from existing PATH to handle cross-platform scenarios
433433
// (e.g., testing Unix-style paths on Windows)
434434
sep := string(os.PathListSeparator) // default to OS separator
@@ -437,7 +437,7 @@ func prependToPath(env []string, dir string) []string {
437437
} else if strings.Contains(currentPath, ":") {
438438
sep = ":"
439439
}
440-
440+
441441
newPath := dir + sep + currentPath
442442
// Preserve original key casing (e.g., "Path" on Windows, "PATH" on Unix)
443443
env[idx] = actualKey + "=" + newPath

cmd/shims/exec_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,11 @@ func TestExecWithShims(t *testing.T) {
334334
// TestFindEnvVar tests the case-insensitive environment variable finder
335335
func TestFindEnvVar(t *testing.T) {
336336
tests := []struct {
337-
name string
338-
env []string
339-
key string
340-
expectedIdx int
341-
expectedKey string
337+
name string
338+
env []string
339+
key string
340+
expectedIdx int
341+
expectedKey string
342342
onlyOnWindows bool
343343
}{
344344
{
@@ -564,7 +564,7 @@ func TestWindowsPathPreservation(t *testing.T) {
564564
require.NotEmpty(t, pathValue, "PATH should be present in result")
565565

566566
// Verify the new directory was prepended
567-
assert.True(t, strings.HasPrefix(pathValue, tt.dir+";"),
567+
assert.True(t, strings.HasPrefix(pathValue, tt.dir+";"),
568568
"PATH should start with new directory: got %s", pathValue)
569569

570570
// Verify the original path component is still present (regression test for #557)

0 commit comments

Comments
 (0)