PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: rsteube/carapace (go)

Issue:
compadd escapes tilde
compadd adds `\` to tilde which breaks path completion

```sh
example action --files ~/<TAB>
# example action --files \~/
```

Either expand `~` to home dir or prevent compadd from escaping it when it is the first character.


Pull request:
zsh: fix tilde expansion
fix #313
fix https://github.com/rsteube/carapace-bin/issues/1277

Patch:
diff --git a/internal/shell/zsh/action.go b/internal/shell/zsh/action.go
index b288e37..2688ddf 100644
--- a/internal/shell/zsh/action.go
+++ b/internal/shell/zsh/action.go
@@ -15,6 +15,38 @@ var sanitizer = strings.NewReplacer(
 	"\t", ``,
 )
 
+// TODO verify these are correct/complete (copied from bash)
+var quoter = strings.NewReplacer(
+	`&`, `\&`,
+	`<`, `\<`,
+	`>`, `\>`,
+	"`", "\\`",
+	`'`, `\'`,
+	`"`, `\"`,
+	`{`, `\{`,
+	`}`, `\}`,
+	`$`, `\$`,
+	`#`, `\#`,
+	`|`, `\|`,
+	`?`, `\?`,
+	`(`, `\(`,
+	`)`, `\)`,
+	`;`, `\;`,
+	` `, `\ `,
+	`[`, `\[`,
+	`]`, `\]`,
+	`*`, `\*`,
+	`\`, `\\`,
+	`~`, `\~`,
+)
+
+func quoteValue(s string) string {
+	if strings.HasPrefix(s, "~") {
+		return "~" + quoter.Replace(strings.TrimPrefix(s, "~")) // assume file path expansion
+	}
+	return quoter.Replace(s)
+}
+
 // ActionRawValues formats values for zsh
 func ActionRawValues(currentWord string, nospace bool, values common.RawValues) string {
 	filtered := make([]common.RawValue, 0)
@@ -45,6 +77,7 @@ func ActionRawValues(currentWord string, nospace bool, values common.RawValues)
 	vals := make([]string, len(filtered))
 	for index, val := range filtered {
 		val.Value = sanitizer.Replace(val.Value)
+		val.Value = quoteValue(val.Value)
 		if nospace {
 			val.Value = val.Value + "\001"
 		}
diff --git a/internal/shell/zsh/snippet.go b/internal/shell/zsh/snippet.go
index defe8e0..8d033f3 100644
--- a/internal/shell/zsh/snippet.go
+++ b/internal/shell/zsh/snippet.go
@@ -42,7 +42,7 @@ function _%v_completion {
   # shellcheck disable=SC2034,2206
   vals=(${vals%%%%$'\001'*})
 
-  compadd -S "${suffix}" -d displays -a -- vals
+  compadd -Q -S "${suffix}" -d displays -a -- vals
 }
 compquote '' 2>/dev/null && _%v_completion
 compdef _%v_completion %v


Test patch:
diff --git a/example/cmd/_test/zsh.sh b/example/cmd/_test/zsh.sh
index 28775ce..fc4df7c 100644
--- a/example/cmd/_test/zsh.sh
+++ b/example/cmd/_test/zsh.sh
@@ -30,7 +30,7 @@ function _example_completion {
   # shellcheck disable=SC2034,2206
   vals=(${vals%%$'\001'*})
 
-  compadd -S "${suffix}" -d displays -a -- vals
+  compadd -Q -S "${suffix}" -d displays -a -- vals
 }
 compquote '' 2>/dev/null && _example_completion
 compdef _example_completion example
Repository: apify/apify-cli (ts)

Issue:
Enable skipping installing optional packages with "apify create"
Now we're installing 90MB puppeteer dependency every time user calls "apify create". We should let them use something like `--no-optional` feature of npm. See https://github.com/apifytech/apify-js/issues/340 for details.

Pull request:
feat: --no-optional for create command
Closes #100 

Patch:
diff --git a/src/commands/create.ts b/src/commands/create.ts
index beebd65..f4ef795 100644
--- a/src/commands/create.ts
+++ b/src/commands/create.ts
@@ -47,6 +47,11 @@ export class CreateCommand extends ApifyCommand<typeof CreateCommand> {
             required: false,
             hidden: true,
         }),
+        'omit-optional-deps': Flags.boolean({
+            aliases: ['no-optional'],
+            description: 'Skip installing optional dependencies.',
+            required: false,
+        }),
     };
 
     static override args = {
@@ -118,6 +123,11 @@ export class CreateCommand extends ApifyCommand<typeof CreateCommand> {
             }
         }
 
+        // Set this _after_ the template is resolved, so that the flag takes precedence
+        if (this.flags.omitOptionalDeps) {
+            skipOptionalDeps = true;
+        }
+
         await downloadAndUnzip({ url: templateArchiveUrl, pathTo: actFolderDir });
 
         // There may be .actor/actor.json file in used template - let's try to load it and change the name prop value to actorName


Test patch:
diff --git a/test/commands/create.test.ts b/test/commands/create.test.ts
index 44e3156..b83b8e6 100644
--- a/test/commands/create.test.ts
+++ b/test/commands/create.test.ts
@@ -80,4 +80,19 @@ describe('apify create', () => {
         expect(loadJsonFileSync<{ name: string }>(actorJsonPath)!.name).to.be.eql(actName);
         expect(loadJsonFileSync(joinPath(getLocalKeyValueStorePath(), `${KEY_VALUE_STORE_KEYS.INPUT}.json`))).to.be.eql(expectedInput);
     });
+
+    it('should skip installing optional dependencies', async () => {
+        const ACT_TEMPLATE = 'project_cheerio_crawler_js';
+        await CreateCommand.run([actName, '--template', ACT_TEMPLATE, '--no-optional'], import.meta.url);
+
+        // check files structure
+        expect(existsSync(tmpPath)).toBeTruthy();
+
+        toggleCwdBetweenFullAndParentPath();
+
+        expect(existsSync(joinPath('package.json'))).toBeTruthy();
+        expect(existsSync(joinPath('node_modules'))).toBeTruthy();
+        expect(existsSync(joinPath('node_modules', 'cheerio'))).toBeTruthy();
+        expect(existsSync(joinPath('node_modules', 'playwright'))).toBeFalsy();
+    });
 });