You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2022/01/20 14:07:52 UTC

[couchdb] branch main updated (9b6454b -> 1a42659)

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

kocolosk pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


    from 9b6454b  Refactor Jenkins build to dynamically generate test stages (#3903)
     new fca5a2e  Forward port erlfmt improvements from #3837
     new 1a42659  Apply new formatting from erlfmt

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 dev/format_all.py                                  |  11 +-
 dev/format_check.py                                |  49 +++---
 dev/format_lib.py                                  |  33 ++--
 src/chttpd/src/chttpd_changes.erl                  |   1 -
 src/chttpd/src/chttpd_db.erl                       |   6 +-
 src/chttpd/test/eunit/chttpd_cors_test.erl         | 168 ++++++++++-----------
 src/couch/src/couch_httpd_auth.erl                 |  11 +-
 src/couch_eval/src/couch_eval.erl                  |   3 +-
 .../src/couch_replicator_api_wrap.erl              |   9 +-
 .../test/eunit/couch_replicator_filtered_tests.erl |  46 +++---
 ...ch_replicator_retain_stats_between_job_runs.erl |  16 +-
 src/couch_views/src/couch_views_batch_impl.erl     |  13 +-
 src/fabric/src/fabric2_db.erl                      |   4 +-
 src/fabric/src/fabric2_fdb.erl                     |   4 +-
 src/fabric/src/fabric2_server.erl                  |  23 +--
 15 files changed, 208 insertions(+), 189 deletions(-)

[couchdb] 01/02: Forward port erlfmt improvements from #3837

Posted by ko...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit fca5a2e0db6208ebe17ffb8717791ac406032796
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Tue Jan 18 22:47:31 2022 -0500

    Forward port erlfmt improvements from #3837
    
    Credit to @nickva for the original improvements. The main branch is
    already Erlang 21+ so the minimum version check is less essential, but
    the performance improvements are greatly appreciated!
---
 dev/format_all.py   | 11 ++++++++---
 dev/format_check.py | 49 ++++++++++++++++++-------------------------------
 dev/format_lib.py   | 33 +++++++++++++++++++++++----------
 3 files changed, 49 insertions(+), 44 deletions(-)

diff --git a/dev/format_all.py b/dev/format_all.py
index 067fc79..1927fb5 100644
--- a/dev/format_all.py
+++ b/dev/format_all.py
@@ -18,13 +18,18 @@ USAGE: ERLFMT_PATH=<path_to_erlfmt> python3 dev/format_all.py
 """
 
 import os
+import sys
 import subprocess
 
-from format_lib import get_source_paths
+from format_lib import get_source_paths, get_erlang_version
 
 if __name__ == "__main__":
-    for item in get_source_paths():
+    if get_erlang_version() < 21:
+        print("Erlang version is < 21. Skipping format check")
+        sys.exit(0)
+
+    for path in get_source_paths():
         subprocess.run(
-            [os.environ["ERLFMT_PATH"], "-w", item["raw_path"]],
+            [os.environ["ERLFMT_PATH"], "-w", path],
             stdout=subprocess.PIPE,
         )
diff --git a/dev/format_check.py b/dev/format_check.py
index 6b46588..cbb0126 100644
--- a/dev/format_check.py
+++ b/dev/format_check.py
@@ -21,41 +21,28 @@ import os
 import subprocess
 import sys
 
-from format_lib import get_source_paths
+from format_lib import get_source_paths, get_erlang_version
 
-FILTERED_LINES = [
-    "Checking formatting...",
-    "[warn] Code style issues found in the above file(s). Forgot to run erlfmt?",
-    "",
-]
 
 if __name__ == "__main__":
-    failed_checks = 0
-    for item in get_source_paths():
+    if get_erlang_version() < 21:
+        print("Erlang version is < 21. Skipping format check")
+        sys.exit(0)
+
+    exit_code = 0
+
+    for path in get_source_paths():
         run_result = subprocess.run(
-            [
-                os.environ["ERLFMT_PATH"],
-                "-c",
-                "--verbose",
-                # We have some long lines and erlfmt doesn't forcefully wrap
-                # them all. We should decrease this over time
-                "--print-width=167",
-                item["raw_path"],
-            ],
+            [os.environ["ERLFMT_PATH"], "-c", path],
             stdout=subprocess.PIPE,
             stderr=subprocess.PIPE,
         )
-        if run_result.returncode != 0:
-            # erlfmt sometimes returns a non-zero status code with no
-            # actual errors. This is a workaround
-            stderr_lines = [
-                line
-                for line in run_result.stderr.decode("utf-8").split("\n")
-                if line not in FILTERED_LINES
-                and not line.startswith("Formatting ")
-                and not line.startswith("[warn] ")
-            ]
-            if len(stderr_lines) > 0:
-                print("\n".join(stderr_lines), file=sys.stderr)
-                failed_checks += 1
-    sys.exit(failed_checks)
+        rc = run_result.returncode
+        if rc != 0:
+            print("\n %s error for %s" % (rc, path))
+            stderr_lines = run_result.stderr.decode("utf-8").split("\n")
+            for line in stderr_lines:
+                print("  > %s" % line, file=sys.stderr)
+            exit_code = 1
+
+    sys.exit(exit_code)
diff --git a/dev/format_lib.py b/dev/format_lib.py
index 563ef8d..3db0057 100644
--- a/dev/format_lib.py
+++ b/dev/format_lib.py
@@ -20,22 +20,35 @@ import pathlib
 import subprocess
 
 
+def get_erlang_version():
+    args = [
+        "erl",
+        "-eval",
+        "io:put_chars(erlang:system_info(otp_release)), halt().",
+        "-noshell",
+    ]
+    res = subprocess.run(args, stdout=subprocess.PIPE, check=True)
+    str_version = res.stdout.decode("utf-8").strip().strip('"')
+    return int(str_version)
+
+
+# Generate source paths as "directory/*.erl" wildcard patterns
+# those can be directly consumed by erlfmt and processed in parallel
+#
 def get_source_paths():
+    curdir = None
     for item in (
         subprocess.run(
-            ["git", "ls-files"],
+            ["git", "ls-files", "--", "*.erl"],
             stdout=subprocess.PIPE,
             stderr=subprocess.PIPE,
         )
         .stdout.decode("utf-8")
         .split("\n")
     ):
-        item_path = pathlib.Path(item)
-        if item_path.suffix != ".erl":
-            continue
-
-        result_dict = {
-            "raw_path": item,
-            "item_path": item_path,
-        }
-        yield result_dict
+        path = pathlib.Path(item)
+        if path.parent != curdir:
+            yield str(path.parent.joinpath("*.erl"))
+            curdir = path.parent
+    if curdir is not None:
+        yield str(curdir.joinpath("*.erl"))

[couchdb] 02/02: Apply new formatting from erlfmt

Posted by ko...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 1a42659b3013a69c27752792688136085d4eb324
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Tue Jan 18 23:02:32 2022 -0500

    Apply new formatting from erlfmt
---
 src/chttpd/src/chttpd_changes.erl                  |   1 -
 src/chttpd/src/chttpd_db.erl                       |   6 +-
 src/chttpd/test/eunit/chttpd_cors_test.erl         | 168 ++++++++++-----------
 src/couch/src/couch_httpd_auth.erl                 |  11 +-
 src/couch_eval/src/couch_eval.erl                  |   3 +-
 .../src/couch_replicator_api_wrap.erl              |   9 +-
 .../test/eunit/couch_replicator_filtered_tests.erl |  46 +++---
 ...ch_replicator_retain_stats_between_job_runs.erl |  16 +-
 src/couch_views/src/couch_views_batch_impl.erl     |  13 +-
 src/fabric/src/fabric2_db.erl                      |   4 +-
 src/fabric/src/fabric2_fdb.erl                     |   4 +-
 src/fabric/src/fabric2_server.erl                  |  23 +--
 12 files changed, 159 insertions(+), 145 deletions(-)

diff --git a/src/chttpd/src/chttpd_changes.erl b/src/chttpd/src/chttpd_changes.erl
index 56ad716..b4feda4 100644
--- a/src/chttpd/src/chttpd_changes.erl
+++ b/src/chttpd/src/chttpd_changes.erl
@@ -638,7 +638,6 @@ keep_sending_changes(Args, Acc0, FirstRound, T0) ->
             end
     end.
 
-
 changes_duration() ->
     %% preserving original (3.x) configuration segment;
     case config:get("fabric", "changes_duration", "infinity") of
diff --git a/src/chttpd/src/chttpd_db.erl b/src/chttpd/src/chttpd_db.erl
index c9a843a..7fa55f8 100644
--- a/src/chttpd/src/chttpd_db.erl
+++ b/src/chttpd/src/chttpd_db.erl
@@ -1684,11 +1684,11 @@ db_attachment_req(#httpd{method = 'GET', mochi_req = MochiReq} = Req, Db, DocId,
         )
     ),
     #doc_query_args{
-        rev=Rev,
-        options=Options
+        rev = Rev,
+        options = Options
     } = parse_doc_query(Req),
     #doc{
-        atts=Atts
+        atts = Atts
     } = Doc = couch_doc_open(Db, DocId, Rev, Options),
     Att = get_existing_attachment(Atts, FileName),
     [Type, Enc, DiskLen, AttLen, Md5] = couch_att:fetch(
diff --git a/src/chttpd/test/eunit/chttpd_cors_test.erl b/src/chttpd/test/eunit/chttpd_cors_test.erl
index fd4a487..7b52f98 100644
--- a/src/chttpd/test/eunit/chttpd_cors_test.erl
+++ b/src/chttpd/test/eunit/chttpd_cors_test.erl
@@ -135,85 +135,80 @@ assert_not_preflight_(Val) ->
 
 cors_disabled_test_() ->
     {"CORS disabled tests", [
-        {"Empty user",
-            {setup,
-                fun chttpd_test_util:start_couch/0,
-                fun chttpd_test_util:stop_couch/1,
-                {foreach, fun empty_cors_config/0, [
-                    fun test_no_access_control_method_preflight_request_/1,
-                    fun test_no_headers_/1,
-                    fun test_no_headers_server_/1,
-                    fun test_no_headers_db_/1
-                ]}
-            }
-        }
+        {"Empty user", {
+            setup,
+            fun chttpd_test_util:start_couch/0,
+            fun chttpd_test_util:stop_couch/1,
+            {foreach, fun empty_cors_config/0, [
+                fun test_no_access_control_method_preflight_request_/1,
+                fun test_no_headers_/1,
+                fun test_no_headers_server_/1,
+                fun test_no_headers_db_/1
+            ]}
+        }}
     ]}.
 
 %% CORS enabled tests
 
 cors_enabled_minimal_config_test_() ->
-    {"Minimal CORS enabled, no Origins",
-        {setup,
-            fun chttpd_test_util:start_couch/0,
-            fun chttpd_test_util:stop_couch/1,
-            {foreach, fun minimal_cors_config/0, [
-                fun test_no_access_control_method_preflight_request_/1,
-                fun test_incorrect_origin_simple_request_/1,
-                fun test_incorrect_origin_preflight_request_/1
-            ]}
-        }
-    }.
+    {"Minimal CORS enabled, no Origins", {
+        setup,
+        fun chttpd_test_util:start_couch/0,
+        fun chttpd_test_util:stop_couch/1,
+        {foreach, fun minimal_cors_config/0, [
+            fun test_no_access_control_method_preflight_request_/1,
+            fun test_incorrect_origin_simple_request_/1,
+            fun test_incorrect_origin_preflight_request_/1
+        ]}
+    }}.
 
 cors_enabled_simple_config_test_() ->
-    {"Simple CORS config",
-        {setup,
-            fun chttpd_test_util:start_couch/0,
-            fun chttpd_test_util:stop_couch/1,
-            {foreach, fun simple_cors_config/0, [
-                fun test_no_access_control_method_preflight_request_/1,
-                fun test_preflight_request_/1,
-                fun test_bad_headers_preflight_request_/1,
-                fun test_good_headers_preflight_request_/1,
-                fun test_db_request_/1,
-                fun test_db_preflight_request_/1,
-                fun test_db_host_origin_request_/1,
-                fun test_preflight_with_port_no_origin_/1,
-                fun test_preflight_with_scheme_no_origin_/1,
-                fun test_preflight_with_scheme_port_no_origin_/1,
-                fun test_case_sensitive_mismatch_of_allowed_origins_/1
-            ]}
-        }
-    }.
+    {"Simple CORS config", {
+        setup,
+        fun chttpd_test_util:start_couch/0,
+        fun chttpd_test_util:stop_couch/1,
+        {foreach, fun simple_cors_config/0, [
+            fun test_no_access_control_method_preflight_request_/1,
+            fun test_preflight_request_/1,
+            fun test_bad_headers_preflight_request_/1,
+            fun test_good_headers_preflight_request_/1,
+            fun test_db_request_/1,
+            fun test_db_preflight_request_/1,
+            fun test_db_host_origin_request_/1,
+            fun test_preflight_with_port_no_origin_/1,
+            fun test_preflight_with_scheme_no_origin_/1,
+            fun test_preflight_with_scheme_port_no_origin_/1,
+            fun test_case_sensitive_mismatch_of_allowed_origins_/1
+        ]}
+    }}.
 
 cors_enabled_custom_config_test_() ->
-    {"Simple CORS config with custom allow_methods/allow_headers/exposed_headers",
-        {setup,
-            fun chttpd_test_util:start_couch/0,
-            fun chttpd_test_util:stop_couch/1,
-            {foreach, fun custom_cors_config/0, [
-                fun test_good_headers_preflight_request_with_custom_config_/1,
-                fun test_db_request_with_custom_config_/1
-            ]}
-        }
-    }.
+    {"Simple CORS config with custom allow_methods/allow_headers/exposed_headers", {
+        setup,
+        fun chttpd_test_util:start_couch/0,
+        fun chttpd_test_util:stop_couch/1,
+        {foreach, fun custom_cors_config/0, [
+            fun test_good_headers_preflight_request_with_custom_config_/1,
+            fun test_db_request_with_custom_config_/1
+        ]}
+    }}.
 
 cors_enabled_multiple_config_test_() ->
-    {"Multiple options CORS config",
-        {setup,
-            fun chttpd_test_util:start_couch/0,
-            fun chttpd_test_util:stop_couch/1,
-            {foreach, fun multiple_cors_config/0, [
-                fun test_no_access_control_method_preflight_request_/1,
-                fun test_preflight_request_/1,
-                fun test_db_request_/1,
-                fun test_db_preflight_request_/1,
-                fun test_db_host_origin_request_/1,
-                fun test_preflight_with_port_with_origin_/1,
-                fun test_preflight_with_scheme_with_origin_/1,
-                fun test_preflight_with_scheme_port_with_origin_/1
-            ]}
-        }
-    }.
+    {"Multiple options CORS config", {
+        setup,
+        fun chttpd_test_util:start_couch/0,
+        fun chttpd_test_util:stop_couch/1,
+        {foreach, fun multiple_cors_config/0, [
+            fun test_no_access_control_method_preflight_request_/1,
+            fun test_preflight_request_/1,
+            fun test_db_request_/1,
+            fun test_db_preflight_request_/1,
+            fun test_db_host_origin_request_/1,
+            fun test_preflight_with_port_with_origin_/1,
+            fun test_preflight_with_scheme_with_origin_/1,
+            fun test_preflight_with_scheme_port_with_origin_/1
+        ]}
+    }}.
 
 %% Access-Control-Allow-Credentials tests
 
@@ -249,25 +244,24 @@ db_request_credentials_header_on_test_() ->
 %% CORS wildcard tests
 
 cors_enabled_wildcard_test_() ->
-    {"Wildcard CORS config",
-        {setup,
-            fun chttpd_test_util:start_couch/0,
-            fun chttpd_test_util:stop_couch/1,
-            {foreach, fun wildcard_cors_config/0, [
-                fun test_no_access_control_method_preflight_request_/1,
-                fun test_preflight_request_/1,
-                fun test_preflight_request_no_allow_credentials_/1,
-                fun test_preflight_request_empty_request_headers_/1,
-                fun test_db_request_/1,
-                fun test_db_preflight_request_/1,
-                fun test_db_host_origin_request_/1,
-                fun test_preflight_with_port_with_origin_/1,
-                fun test_preflight_with_scheme_with_origin_/1,
-                fun test_preflight_with_scheme_port_with_origin_/1,
-                fun test_case_sensitive_mismatch_of_allowed_origins_/1
-            ]}
-        }
-    }.
+    {"Wildcard CORS config", {
+        setup,
+        fun chttpd_test_util:start_couch/0,
+        fun chttpd_test_util:stop_couch/1,
+        {foreach, fun wildcard_cors_config/0, [
+            fun test_no_access_control_method_preflight_request_/1,
+            fun test_preflight_request_/1,
+            fun test_preflight_request_no_allow_credentials_/1,
+            fun test_preflight_request_empty_request_headers_/1,
+            fun test_db_request_/1,
+            fun test_db_preflight_request_/1,
+            fun test_db_host_origin_request_/1,
+            fun test_preflight_with_port_with_origin_/1,
+            fun test_preflight_with_scheme_with_origin_/1,
+            fun test_preflight_with_scheme_port_with_origin_/1,
+            fun test_case_sensitive_mismatch_of_allowed_origins_/1
+        ]}
+    }}.
 
 %% Test generators
 
diff --git a/src/couch/src/couch_httpd_auth.erl b/src/couch/src/couch_httpd_auth.erl
index 1bc787d..802dcd9 100644
--- a/src/couch/src/couch_httpd_auth.erl
+++ b/src/couch/src/couch_httpd_auth.erl
@@ -103,8 +103,13 @@ basic_name_pw(Req) ->
             [Basic, Base64Value] = string:split(Header, " "),
             case string:casefold(Basic) of
                 "basic" ->
-                    try re:split(base64:decode(Base64Value), ":",
-                                    [{return, list}, {parts, 2}]) of
+                    try
+                        re:split(
+                            base64:decode(Base64Value),
+                            ":",
+                            [{return, list}, {parts, 2}]
+                        )
+                    of
                         ["_", "_"] ->
                             % special name and pass to be logged out
                             nil;
@@ -115,7 +120,7 @@ basic_name_pw(Req) ->
                     catch
                         error:function_clause ->
                             throw({
-                                bad_request, 
+                                bad_request,
                                 "Authorization header has invalid base64 value"
                             })
                     end;
diff --git a/src/couch_eval/src/couch_eval.erl b/src/couch_eval/src/couch_eval.erl
index e5dc210..2f78477 100644
--- a/src/couch_eval/src/couch_eval.erl
+++ b/src/couch_eval/src/couch_eval.erl
@@ -67,7 +67,8 @@
 -callback validate_doc_update(ddoc(), doc(), doc(), user_context(), sec_obj()) ->
     ok | {error, any()}.
 -callback filter_view(ddoc(), function_name(), [doc()]) -> {true, [result()]} | {error, any()}.
--callback filter_docs(req(), db(), ddoc(), function_name(), [doc()]) -> {true, [result()]} | {error, any()}.
+-callback filter_docs(req(), db(), ddoc(), function_name(), [doc()]) ->
+    {true, [result()]} | {error, any()}.
 
 -spec acquire_map_context(
     db_name(),
diff --git a/src/couch_replicator/src/couch_replicator_api_wrap.erl b/src/couch_replicator/src/couch_replicator_api_wrap.erl
index 2fa9feb..dd7d1ae 100644
--- a/src/couch_replicator/src/couch_replicator_api_wrap.erl
+++ b/src/couch_replicator/src/couch_replicator_api_wrap.erl
@@ -1035,10 +1035,11 @@ db_from_json(#{} = DbMap) ->
         [],
         Headers0
     ),
-    Socks5 = case maps:get(<<"proxy_protocol">>, IBrowseOptions0, undefined) of
-        <<"socks5">> -> true;
-        _ -> false
-    end,
+    Socks5 =
+        case maps:get(<<"proxy_protocol">>, IBrowseOptions0, undefined) of
+            <<"socks5">> -> true;
+            _ -> false
+        end,
     IBrowseOptions = maps:fold(
         fun
             (<<"socket_options">>, #{} = SockOpts, Acc) ->
diff --git a/src/couch_replicator/test/eunit/couch_replicator_filtered_tests.erl b/src/couch_replicator/test/eunit/couch_replicator_filtered_tests.erl
index 21a691c..cbc6746 100644
--- a/src/couch_replicator/test/eunit/couch_replicator_filtered_tests.erl
+++ b/src/couch_replicator/test/eunit/couch_replicator_filtered_tests.erl
@@ -22,31 +22,37 @@
     <<"_id">> => ?DDOC_ID,
     <<"filters">> => #{
         <<"testfilter">> =>
-            <<"\n"
-            "            function(doc, req){if (doc.class == 'mammal') return true;}\n"
-            "        ">>,
+            <<
+                "\n"
+                "            function(doc, req){if (doc.class == 'mammal') return true;}\n"
+                "        "
+            >>,
         <<"queryfilter">> =>
-            <<"\n"
-            "            function(doc, req) {\n"
-            "                if (doc.class && req.query.starts) {\n"
-            "                    return doc.class.indexOf(req.query.starts) === 0;\n"
-            "                }\n"
-            "                else {\n"
-            "                    return false;\n"
-            "                }\n"
-            "            }\n"
-            "        ">>
+            <<
+                "\n"
+                "            function(doc, req) {\n"
+                "                if (doc.class && req.query.starts) {\n"
+                "                    return doc.class.indexOf(req.query.starts) === 0;\n"
+                "                }\n"
+                "                else {\n"
+                "                    return false;\n"
+                "                }\n"
+                "            }\n"
+                "        "
+            >>
     },
     <<"views">> => #{
         <<"mammals">> => #{
             <<"map">> =>
-                <<"\n"
-                "                function(doc) {\n"
-                "                    if (doc.class == 'mammal') {\n"
-                "                        emit(doc._id, null);\n"
-                "                    }\n"
-                "                }\n"
-                "            ">>
+                <<
+                    "\n"
+                    "                function(doc) {\n"
+                    "                    if (doc.class == 'mammal') {\n"
+                    "                        emit(doc._id, null);\n"
+                    "                    }\n"
+                    "                }\n"
+                    "            "
+                >>
         }
     }
 }).
diff --git a/src/couch_replicator/test/eunit/couch_replicator_retain_stats_between_job_runs.erl b/src/couch_replicator/test/eunit/couch_replicator_retain_stats_between_job_runs.erl
index edc4c5b..2cdc5da 100644
--- a/src/couch_replicator/test/eunit/couch_replicator_retain_stats_between_job_runs.erl
+++ b/src/couch_replicator/test/eunit/couch_replicator_retain_stats_between_job_runs.erl
@@ -156,13 +156,15 @@ cancel(RepId, Pid) ->
     couch_replicator_test_helper:cancel(RepId, Pid).
 
 vdu() ->
-    <<"function(newDoc, oldDoc, userCtx) {\n"
-    "        if(newDoc.nope === true) {\n"
-    "            throw({forbidden: 'nope'});\n"
-    "        } else {\n"
-    "            return;\n"
-    "        }\n"
-    "    }">>.
+    <<
+        "function(newDoc, oldDoc, userCtx) {\n"
+        "        if(newDoc.nope === true) {\n"
+        "            throw({forbidden: 'nope'});\n"
+        "        } else {\n"
+        "            return;\n"
+        "        }\n"
+        "    }"
+    >>.
 
 add_vdu(DbName) ->
     DocProps = [
diff --git a/src/couch_views/src/couch_views_batch_impl.erl b/src/couch_views/src/couch_views_batch_impl.erl
index 8588528..d4eebdb 100644
--- a/src/couch_views/src/couch_views_batch_impl.erl
+++ b/src/couch_views/src/couch_views_batch_impl.erl
@@ -162,12 +162,13 @@ bad_config_test_() ->
     lists:map(
         fun({Field, Error}) ->
             FieldName = atom_to_list(Field),
-            {FieldName, ?_assertError(
-                {Error, {couch_views, Field, _}},
-                with_bad_config(FieldName, fun() ->
-                    start(#mrst{}, undefined)
-                end))
-            }
+            {FieldName,
+                ?_assertError(
+                    {Error, {couch_views, Field, _}},
+                    with_bad_config(FieldName, fun() ->
+                        start(#mrst{}, undefined)
+                    end)
+                )}
         end,
         FieldErrors
     ).
diff --git a/src/fabric/src/fabric2_db.erl b/src/fabric/src/fabric2_db.erl
index 7521fc4..b29aced 100644
--- a/src/fabric/src/fabric2_db.erl
+++ b/src/fabric/src/fabric2_db.erl
@@ -808,7 +808,9 @@ validate_docid(<<"_design/">>) ->
 validate_docid(<<"_local/">>) ->
     throw({illegal_docid, <<"Illegal document id `_local/`">>});
 validate_docid(Id) when is_binary(Id) ->
-    ConfigDocIdLength = config:get_integer("couchdb", "max_document_id_length", ?DOC_ID_LIMIT_BYTES),
+    ConfigDocIdLength = config:get_integer(
+        "couchdb", "max_document_id_length", ?DOC_ID_LIMIT_BYTES
+    ),
     DocIdLength = min(ConfigDocIdLength, ?DOC_ID_LIMIT_BYTES),
     case DocIdLength > 0 andalso byte_size(Id) > DocIdLength of
         true -> throw({illegal_docid, <<"Document id is too long">>});
diff --git a/src/fabric/src/fabric2_fdb.erl b/src/fabric/src/fabric2_fdb.erl
index 94ab190..f68ac41 100644
--- a/src/fabric/src/fabric2_fdb.erl
+++ b/src/fabric/src/fabric2_fdb.erl
@@ -2155,8 +2155,8 @@ get_info_wait_int(#info_future{} = InfoFuture) ->
 
 binary_chunk_size() ->
     ConfigBinaryChunkSize = config:get_integer(
-        "fabric", 
-        "binary_chunk_size", 
+        "fabric",
+        "binary_chunk_size",
         ?DEFAULT_BINARY_CHUNK_SIZE_BYTES
     ),
     min(ConfigBinaryChunkSize, ?DEFAULT_BINARY_CHUNK_SIZE_BYTES).
diff --git a/src/fabric/src/fabric2_server.erl b/src/fabric/src/fabric2_server.erl
index d0587ee..14c0329 100644
--- a/src/fabric/src/fabric2_server.erl
+++ b/src/fabric/src/fabric2_server.erl
@@ -150,16 +150,19 @@ init(_) ->
     {ok, nil}.
 
 check_config_limits() ->
-    lists:foreach(fun({Sect, Key, Limit}) ->
-        ConfigVal = config:get_integer(Sect, Key, Limit),
-        case ConfigVal > Limit of
-            true ->
-                LogMsg = "Config value of ~p for [~s] ~s is greater than the limit: ~p",
-                couch_log:warning(LogMsg, [ConfigVal, Sect, Key, Limit]);
-            false ->
-                ok
-        end
-    end, ?CONFIG_LIMITS).
+    lists:foreach(
+        fun({Sect, Key, Limit}) ->
+            ConfigVal = config:get_integer(Sect, Key, Limit),
+            case ConfigVal > Limit of
+                true ->
+                    LogMsg = "Config value of ~p for [~s] ~s is greater than the limit: ~p",
+                    couch_log:warning(LogMsg, [ConfigVal, Sect, Key, Limit]);
+                false ->
+                    ok
+            end
+        end,
+        ?CONFIG_LIMITS
+    ).
 
 terminate(_, _St) ->
     ok.