PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: Kong/swrv (ts)

Issue:
throw better error when useSwrv is not top level in setup
I find that when new users to the setup/composition api use swrv, they get a little confused with this error:

```
TypeError: cannot read 'proxy' of null
```

https://github.com/Kong/swrv/blob/ac9981615abadac080d4df3ea9ba325ef5ac54e4/src/use-swrv.ts#L160

Example issue:
https://github.com/Kong/swrv/issues/40

Let's improve it


Pull request:
chore(swrv) improved error message for top level
Fixes #133

Patch:
diff --git a/src/use-swrv.ts b/src/use-swrv.ts
index c467481..9c66493 100644
--- a/src/use-swrv.ts
+++ b/src/use-swrv.ts
@@ -157,7 +157,11 @@ function useSWRV<Data = any, Error = any> (...args): IResponse<Data, Error> {
   let isHydrated = false
 
   const instance = getCurrentInstance() as any
-  const vm = instance.proxy || instance // https://github.com/vuejs/composition-api/pull/520
+  const vm = instance?.proxy || instance // https://github.com/vuejs/composition-api/pull/520
+  if (!vm) {
+    throw new Error('Could not get current instance, check to make sure that `useSwrv` is declared in the top level of the setup function.')
+  }
+
   const IS_SERVER = vm.$isServer
   const isSsrHydration = Boolean(
     !IS_SERVER &&


Test patch:
diff --git a/tests/use-swrv.spec.tsx b/tests/use-swrv.spec.tsx
index 7502c3f..e06b7ca 100644
--- a/tests/use-swrv.spec.tsx
+++ b/tests/use-swrv.spec.tsx
@@ -1196,6 +1196,29 @@ describe('useSWRV - error', () => {
 
     done()
   })
+
+  it('should display friendly error message when swrv is not top level in setup', async done => {
+    const spy = jest.spyOn(console, 'error').mockImplementation(() => {})
+    const vm = new Vue({
+      template: '<button v-on:click="dontDoThis">bad idea</button>',
+      setup  () {
+        function dontDoThis () {
+          useSWRV(() => 'error-top-level', () => 'hello')
+        }
+
+        return {
+          dontDoThis
+        }
+      }
+    }).$mount()
+
+    vm.$el.click()
+
+    expect(spy).toHaveBeenCalledWith(expect.stringContaining('Could not get current instance, check to make sure that `useSwrv` is declared in the top level of the setup function.'))
+
+    spy.mockRestore()
+    done()
+  })
 })
 
 describe('useSWRV - window events', () => {
Repository: googlemaps/google-maps-services-js (ts)

Issue:
Support Custom Axios Instance on Client Class
this makes a custom axios instance with retries as in #326 a bit easier at the class level

Pull request:
feat: support passing custom AxiosInstance to client
closes #342

Patch:
diff --git a/src/client.ts b/src/client.ts
index 41e698336..7776f946d 100644
--- a/src/client.ts
+++ b/src/client.ts
@@ -81,6 +81,9 @@ const defaultConfig = {
 export const defaultAxiosInstance = axios.create(defaultConfig);
 
 export interface ClientOptions {
+  /** AxiosInstance to be used by client. Provide one of axiosInstance or config. */
+  axiosInstance?: AxiosInstance;
+  /** Config used to create AxiosInstance. Provide one of axiosInstance or config. */
   config?: AxiosRequestConfig;
   experienceId?: string[];
 }
@@ -89,8 +92,16 @@ export class Client {
   private axiosInstance: AxiosInstance;
   private experienceId: string[];
 
-  constructor({ config, experienceId }: ClientOptions) {
-    if (config) {
+  constructor({ axiosInstance, config, experienceId }: ClientOptions) {
+    if (axiosInstance && config) {
+      throw new Error("Provide one of axiosInstance or config.");
+    }
+
+    if (axiosInstance) {
+      this.axiosInstance = axiosInstance;
+      // Avoid changing this instance in any way that affects its behavior
+      this.axiosInstance.defaults.headers["User-Agent"] = userAgent;
+    } else if (config) {
       this.axiosInstance = axios.create(merge(defaultConfig, config));
     } else {
       this.axiosInstance = defaultAxiosInstance;


Test patch:
diff --git a/src/client.test.ts b/src/client.test.ts
index e137933c4..759c9fc24 100644
--- a/src/client.test.ts
+++ b/src/client.test.ts
@@ -17,14 +17,41 @@ import {
   TextSearchRequest,
   NearestRoadsRequest,
   SnapToRoadsRequest,
-  X_GOOG_MAPS_EXPERIENCE_ID
+  X_GOOG_MAPS_EXPERIENCE_ID,
+  defaultAxiosInstance
 } from "./client";
 
+import axios from "axios";
+
 test("client can be instantiated", () => {
   const client = new Client({});
   expect(client["axiosInstance"]).toBeDefined();
 });
 
+test("client can be instantiated with axiosInstance", () => {
+  const client = new Client({ axiosInstance: axios.create({}) });
+  expect(client["axiosInstance"]).toBeDefined();
+});
+
+test("client can be instantiated with axiosInstance has correct defaults", () => {
+  const client = new Client({ axiosInstance: axios.create({}) });
+  expect(client["axiosInstance"].defaults.headers["User-Agent"]).toEqual(
+    userAgent
+  );
+  expect(client["axiosInstance"].defaults.timeout).toEqual(
+    axios.defaults.timeout
+  );
+});
+
+test("client instantiated with custom instance and config throws error", () => {
+  expect(() => {
+    new Client({
+      axiosInstance: defaultAxiosInstance,
+      config: { timeout: 10000 }
+    });
+  }).toThrowError();
+});
+
 test("client can be instantiated with header options", () => {
   const client = new Client({ config: { headers: { "x-foo": "bar" } } });
   expect(client["axiosInstance"]).toBeDefined();
Repository: detekt/detekt (kotlin)

Issue:
When setting `config -> excludes -> ''` to empty string misleading error is logged
## Expected Behavior
Setting `config -> excludes -> ''` should print some error like below
`Value "" set for config parameter "config > excludes" is not of required type List.`

## Observed Behavior
The below error is getting printed
`Value "" set for config parameter "config > excludes" is not of required type EmptyList.`
See `EmptyList`, it should be `List`

## Steps to Reproduce
In latest branch

## Context
Was updating the detekt to latest snapshot

## Your Environment
NA

Pull request:
Fixes https://github.com/detekt/detekt/issues/7433

Patch:
diff --git a/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/config/BaseConfig.kt b/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/config/BaseConfig.kt
index 072556b4ff02..d43dd2826e16 100644
--- a/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/config/BaseConfig.kt
+++ b/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/config/BaseConfig.kt
@@ -41,15 +41,21 @@ fun Config.valueOrDefaultInternal(
     } catch (_: ClassCastException) {
         error(
             "Value \"$result\" set for config parameter \"${keySequence(key)}\" is not of" +
-                " required type ${default::class.simpleName}."
+                " required type ${default::class.simpleName?.let { getDefaultName(it) }}."
         )
     } catch (_: NumberFormatException) {
         error(
             "Value \"$result\" set for config parameter \"${keySequence(key)}\" is not of" +
-                " required type ${default::class.simpleName}."
+                " required type ${default::class.simpleName?.let { getDefaultName(it) }}."
         )
     }
 
+private fun getDefaultName(className: String): String = if (className == "EmptyList") {
+    "List"
+} else {
+    className
+}
+
 fun tryParseBasedOnDefault(result: String, defaultResult: Any): Any = when (defaultResult) {
     is Int -> result.toInt()
     is Boolean ->


Test patch:
diff --git a/detekt-core/src/test/kotlin/io/gitlab/arturbosch/detekt/core/config/YamlConfigSpec.kt b/detekt-core/src/test/kotlin/io/gitlab/arturbosch/detekt/core/config/YamlConfigSpec.kt
index 355c8024dc24..315e1fdcee8c 100644
--- a/detekt-core/src/test/kotlin/io/gitlab/arturbosch/detekt/core/config/YamlConfigSpec.kt
+++ b/detekt-core/src/test/kotlin/io/gitlab/arturbosch/detekt/core/config/YamlConfigSpec.kt
@@ -153,6 +153,17 @@ class YamlConfigSpec {
                     "Value \"[1, 2]\" set for config parameter \"key\" contains non-string values."
             )
         }
+
+        @Test
+        fun `prints meaningful message when string is used instead of list of strings`() {
+            assertThatIllegalStateException().isThrownBy {
+                config.valueOrDefaultInternal(key = "key", result = "", default = emptyList<String>())
+            }.withMessage(
+                """
+                    Value "" set for config parameter "key" is not of required type List.
+                """.trimIndent()
+            )
+        }
     }
 
     @Nested