You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2021/05/17 18:42:41 UTC

[GitHub] [couchdb] nickva commented on a change in pull request #3568: Reformat src files with erlfmt

nickva commented on a change in pull request #3568:
URL: https://github.com/apache/couchdb/pull/3568#discussion_r633761200



##########
File path: src/aegis/src/aegis.erl
##########
@@ -33,50 +31,47 @@ init_db(#{} = Db, Options) ->
         is_encrypted => aegis_server:init_db(Db, Options)
     }.
 
-
 open_db(#{} = Db) ->
     Db#{
         is_encrypted => aegis_server:open_db(Db)
     }.
 
-
 get_db_info(#{is_encrypted := IsEncrypted} = Db) ->
-    KeyManagerInfo = case erlang:function_exported(?AEGIS_KEY_MANAGER, get_db_info, 1) of
-        true ->
-            ?AEGIS_KEY_MANAGER:get_db_info(Db);
-        false ->
-            []
-    end,
+    KeyManagerInfo =
+        case erlang:function_exported(?AEGIS_KEY_MANAGER, get_db_info, 1) of
+            true ->
+                ?AEGIS_KEY_MANAGER:get_db_info(Db);
+            false ->
+                []
+        end,
     [{enabled, IsEncrypted}, {key_manager, {KeyManagerInfo}}].
 
-
 encrypt(#{} = _Db, _Key, <<>>) ->
     <<>>;
-
 encrypt(#{is_encrypted := false}, _Key, Value) when is_binary(Value) ->
     Value;
-
-encrypt(#{is_encrypted := true} = Db, Key, Value)
-        when is_binary(Key), is_binary(Value) ->
+encrypt(#{is_encrypted := true} = Db, Key, Value) when
+    is_binary(Key), is_binary(Value)
+->
     aegis_server:encrypt(Db, Key, Value).
 
-
 decrypt(#{} = Db, Rows) when is_list(Rows) ->
-    lists:map(fun({Key, Value}) ->
-        {Key, decrypt(Db, Key, Value)}
-    end, Rows).
+    lists:map(
+        fun({Key, Value}) ->
+            {Key, decrypt(Db, Key, Value)}
+        end,
+        Rows
+    ).
 
 decrypt(#{} = _Db, _Key, <<>>) ->
     <<>>;
-
 decrypt(#{is_encrypted := false}, _Key, Value) when is_binary(Value) ->
     Value;
-
-decrypt(#{is_encrypted := true} = Db, Key, Value)
-        when is_binary(Key), is_binary(Value) ->
+decrypt(#{is_encrypted := true} = Db, Key, Value) when
+    is_binary(Key), is_binary(Value)
+->

Review comment:
       That does look odd




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org