Fix CI (#3650)
diff --git a/Makefile b/Makefile
index adac5d1..262a566 100644
--- a/Makefile
+++ b/Makefile
@@ -73,7 +73,7 @@
# Rebar options
apps=
-skip_deps=folsom,meck,mochiweb,proper,bcrypt,hyper,local
+skip_deps=folsom,meck,mochiweb,proper,bcrypt,hyper,ibrowse,local
suites=
tests=
diff --git a/build-aux/Jenkinsfile.full b/build-aux/Jenkinsfile.full
index 9b64745..144c18b 100644
--- a/build-aux/Jenkinsfile.full
+++ b/build-aux/Jenkinsfile.full
@@ -95,6 +95,7 @@
set
rm -rf apache-couchdb-*
./configure
+ make erlfmt-check
make dist
chmod -R a+w * .
'''
diff --git a/build-aux/Jenkinsfile.pr b/build-aux/Jenkinsfile.pr
index 8d89b33..b230a1b 100644
--- a/build-aux/Jenkinsfile.pr
+++ b/build-aux/Jenkinsfile.pr
@@ -82,6 +82,7 @@
rm -rf apache-couchdb-*
. /usr/local/kerl/${LOW_ERLANG_VER}/activate
./configure
+ make erlfmt-check
make dist
chmod -R a+w * .
'''
diff --git a/dev/format_all.py b/dev/format_all.py
index 60dff9c..067fc79 100644
--- a/dev/format_all.py
+++ b/dev/format_all.py
@@ -26,6 +26,5 @@
for item in get_source_paths():
subprocess.run(
[os.environ["ERLFMT_PATH"], "-w", item["raw_path"]],
- encoding="utf-8",
stdout=subprocess.PIPE,
)
diff --git a/dev/format_check.py b/dev/format_check.py
index b9b3c34..6b46588 100644
--- a/dev/format_check.py
+++ b/dev/format_check.py
@@ -32,32 +32,30 @@
if __name__ == "__main__":
failed_checks = 0
for item in get_source_paths():
- if item["is_source_path"]:
- 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"],
- ],
- encoding="utf-8",
- 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.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
+ 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"],
+ ],
+ 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)
diff --git a/dev/format_lib.py b/dev/format_lib.py
index fc95fa7..563ef8d 100644
--- a/dev/format_lib.py
+++ b/dev/format_lib.py
@@ -21,12 +21,15 @@
def get_source_paths():
- for item in subprocess.run(
- ["git", "ls-files"],
- encoding="utf-8",
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- ).stdout.split("\n"):
+ for item in (
+ subprocess.run(
+ ["git", "ls-files"],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ )
+ .stdout.decode("utf-8")
+ .split("\n")
+ ):
item_path = pathlib.Path(item)
if item_path.suffix != ".erl":
continue