You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ji...@apache.org on 2024/12/30 17:56:18 UTC

(couchdb) 03/07: Prefix unused variables with an underscore

This is an automated email from the ASF dual-hosted git repository.

jiahuili430 pushed a commit to branch fix-elixir-compile-warnings
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 39648636d40fd59ac5347067b730090282f26d30
Author: Jiahui Li <li...@gmail.com>
AuthorDate: Fri Aug 16 16:13:18 2024 -0500

    Prefix unused variables with an underscore
    
    ```
         warning: variable "context" is unused (if the variable is not meant to be used, prefix it with an underscore)
         │
     140 │   test "user-agent header is forbidden", context do
         │                                          ~~~~~~~
         │
         └─ test/elixir/test/nouveau_test.exs:140:42: NouveauTest."test user-agent header is forbidden"/1
    ```
---
 test/elixir/test/auth_lockout_test.exs | 3 +--
 test/elixir/test/basics_test.exs       | 2 +-
 test/elixir/test/nouveau_test.exs      | 8 ++++----
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/test/elixir/test/auth_lockout_test.exs b/test/elixir/test/auth_lockout_test.exs
index fc70c25a9..b039c86eb 100644
--- a/test/elixir/test/auth_lockout_test.exs
+++ b/test/elixir/test/auth_lockout_test.exs
@@ -56,10 +56,9 @@ defmodule AuthLockoutTest do
     end
 
     # warning?
-    resp = Couch.get("/_all_dbs",
+    _resp = Couch.get("/_all_dbs",
       no_auth: true,
       headers:  [authorization: "Basic #{:base64.encode("chttpd_auth_lockout:baz")}"]
     )
   end
-
 end
diff --git a/test/elixir/test/basics_test.exs b/test/elixir/test/basics_test.exs
index 94faf3c2e..3c04ce8a2 100644
--- a/test/elixir/test/basics_test.exs
+++ b/test/elixir/test/basics_test.exs
@@ -383,7 +383,7 @@ defmodule BasicsTest do
   end
 
   @tag :with_db
-  test "request ID can be specified at the client", context do
+  test "request ID can be specified at the client", _context do
     uuid = "E7498DE1-B661-42FA-943D-17F890143068"
     resp = Couch.get("/", headers: ["X-Couch-Request-ID": uuid])
     assert resp.headers["X-Couch-Request-ID"] == uuid
diff --git a/test/elixir/test/nouveau_test.exs b/test/elixir/test/nouveau_test.exs
index a083755f0..5f97c0aa3 100644
--- a/test/elixir/test/nouveau_test.exs
+++ b/test/elixir/test/nouveau_test.exs
@@ -137,13 +137,13 @@ defmodule NouveauTest do
       "status code: #{resp.status_code}, resp body: #{:jiffy.encode(resp.body)}"
   end
 
-  test "user-agent header is forbidden", context do
+  test "user-agent header is forbidden", _context do
     resp = Couch.get("http://127.0.0.1:5987",
       headers: ["User-Agent": "couchdb"])
     assert_status_code(resp, 403)
   end
 
-  test "search analyze", context do
+  test "search analyze", _context do
     url = "/_nouveau_analyze"
     resp = Couch.post(url,
       headers: ["Content-Type": "application/json"],
@@ -585,7 +585,7 @@ defmodule NouveauTest do
   @tag :with_db
   test "purge with conflicts", context do
     db_name = context[:db_name]
-    create_resp = create_conflicted_search_docs(db_name)
+    _create_resp = create_conflicted_search_docs(db_name)
     create_ddoc(db_name)
 
     search_url = "/#{db_name}/_design/foo/_nouveau/bar"
@@ -621,7 +621,7 @@ defmodule NouveauTest do
 
     resp = Couch.get(search_url, query: %{q: "*:*", include_docs: true})
     assert_status_code(resp, 200)
-    hits = Enum.sort(resp.body["hits"])
+    _hits = Enum.sort(resp.body["hits"])
 
     assert get_total_hits(resp) == 2
     [hit1, hit2] = Enum.sort(resp.body["hits"])