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

[couchdb] branch master updated: Fix exunit compiler warnings

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

jaydoane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/master by this push:
     new e384221  Fix exunit compiler warnings
     new 2f75540  Merge pull request #2355 from cloudant/exunit-compiler-warnings
e384221 is described below

commit e3842215159840a2cf45780221c07d1b3d1811a3
Author: Jay Doane <ja...@apache.org>
AuthorDate: Wed Dec 11 11:59:26 2019 -0800

    Fix exunit compiler warnings
    
    This suppresses the following warnings emitted during `make exunit`:
    
    ```
    ==> couchdbtest
    Compiling 12 files (.ex)
    warning: variable "config_file" is unused (if the variable is not meant to be used, prefix it with an underscore)
      test/elixir/lib/step/config.ex:15
    
    warning: variable "setup" is unused (if the variable is not meant to be used, prefix it with an underscore)
      test/elixir/lib/step/create_db.ex:44
    
    warning: variable "step" is unused (if the variable is not meant to be used, prefix it with an underscore)
      test/elixir/lib/step/create_db.ex:44
    
    warning: variable "setup" is unused (if the variable is not meant to be used, prefix it with an underscore)
      test/elixir/lib/step/user.ex:35
    
    warning: variable "setup" is unused (if the variable is not meant to be used, prefix it with an underscore)
      test/elixir/lib/step/user.ex:78
    
    warning: variable "step" is unused (if the variable is not meant to be used, prefix it with an underscore)
      test/elixir/lib/step/user.ex:78
    
    warning: unused import ExUnit.Assertions.assert/1
      test/elixir/lib/step/create_db.ex:22
    
    warning: unused alias Step
      test/elixir/lib/step/user.ex:18
    ```
---
 test/elixir/lib/step/config.ex    | 4 ++--
 test/elixir/lib/step/create_db.ex | 6 +++---
 test/elixir/lib/step/user.ex      | 7 +++----
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/test/elixir/lib/step/config.ex b/test/elixir/lib/step/config.ex
index 9d9ac8e..41d5599 100644
--- a/test/elixir/lib/step/config.ex
+++ b/test/elixir/lib/step/config.ex
@@ -12,7 +12,7 @@ defmodule Couch.Test.Setup.Step.Config do
     setup |> Setup.step(id, %__MODULE__{config_file: config_file})
   end
 
-  def setup(_setup, %__MODULE__{config_file: config_file} = step) do
+  def setup(_setup, %__MODULE__{config_file: _config_file} = step) do
     # TODO we would need to access config file here
     %{step | config: %{
        backdoor: %{
@@ -30,4 +30,4 @@ defmodule Couch.Test.Setup.Step.Config do
   def get(%__MODULE__{config: config}) do
     config
   end
-end
\ No newline at end of file
+end
diff --git a/test/elixir/lib/step/create_db.ex b/test/elixir/lib/step/create_db.ex
index 3cca3c5..d38e672 100644
--- a/test/elixir/lib/step/create_db.ex
+++ b/test/elixir/lib/step/create_db.ex
@@ -19,7 +19,7 @@ defmodule Couch.Test.Setup.Step.Create.DB do
 
   defstruct [:name]
 
-  import ExUnit.Assertions, only: [assert: 1, assert: 2]
+  import ExUnit.Assertions, only: [assert: 2]
 
   import Utils
 
@@ -41,7 +41,7 @@ defmodule Couch.Test.Setup.Step.Create.DB do
     step
   end
 
-  def teardown(setup, %__MODULE__{name: name} = step) do
+  def teardown(_setup, %__MODULE__{name: name} = _step) do
     :fabric.delete_db(name, [@admin])
     :ok
   end
@@ -50,4 +50,4 @@ defmodule Couch.Test.Setup.Step.Create.DB do
     name
   end
 
-end
\ No newline at end of file
+end
diff --git a/test/elixir/lib/step/user.ex b/test/elixir/lib/step/user.ex
index 5a1cab3..63b8f44 100644
--- a/test/elixir/lib/step/user.ex
+++ b/test/elixir/lib/step/user.ex
@@ -15,7 +15,6 @@ defmodule Couch.Test.Setup.Step.User do
   """
 
   alias Couch.Test.Setup
-  alias Couch.Test.Setup.Step
   alias Couch.Test.Utils
 
   import ExUnit.Callbacks, only: [on_exit: 1]
@@ -32,7 +31,7 @@ defmodule Couch.Test.Setup.Step.User do
     setup |> Setup.step(id, %__MODULE__{roles: roles || []})
   end
 
-  def setup(setup, %__MODULE__{roles: roles} = step) do
+  def setup(_setup, %__MODULE__{roles: roles} = step) do
     users_db = IO.chardata_to_string(
       :config.get('chttpd_auth', 'authentication_db', '_users'))
     if not Utils.db_exists?(users_db) do
@@ -75,7 +74,7 @@ defmodule Couch.Test.Setup.Step.User do
     end
   end
 
-  def teardown(setup, %__MODULE__{name: name, users_db: users_db, roles: roles} = step) do
+  def teardown(_setup, %__MODULE__{name: name, users_db: users_db, roles: roles} = _step) do
     if :server_admin in roles do
       :config.delete("admins", String.to_charlist(name), false)
     else
@@ -101,4 +100,4 @@ defmodule Couch.Test.Setup.Step.User do
     {name, pass}
   end
 
-end
\ No newline at end of file
+end