summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBessenyei Balázs Donát <9086834+bessbd@users.noreply.github.com>2021-07-01 16:55:26 +0200
committerGitHub <noreply@github.com>2021-07-01 16:55:26 +0200
commit66096c779abed76ff7d41386a1bcb15823e247f4 (patch)
tree8812835aa4bbf191fcb492b77f56bc05f15cc304
parentcf71d00cb4b41da5527230d62b63e714c7777cf2 (diff)
downloadcouchdb-66096c779abed76ff7d41386a1bcb15823e247f4.tar.gz
Fix CI (#3650)
-rw-r--r--Makefile2
-rw-r--r--build-aux/Jenkinsfile.full1
-rw-r--r--build-aux/Jenkinsfile.pr1
-rw-r--r--dev/format_all.py1
-rw-r--r--dev/format_check.py54
-rw-r--r--dev/format_lib.py15
6 files changed, 38 insertions, 36 deletions
diff --git a/Makefile b/Makefile
index adac5d10f..262a56647 100644
--- a/Makefile
+++ b/Makefile
@@ -73,7 +73,7 @@ DESTDIR=
# 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 9b6474513..144c18b39 100644
--- a/build-aux/Jenkinsfile.full
+++ b/build-aux/Jenkinsfile.full
@@ -95,6 +95,7 @@ pipeline {
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 8d89b33ab..b230a1b74 100644
--- a/build-aux/Jenkinsfile.pr
+++ b/build-aux/Jenkinsfile.pr
@@ -82,6 +82,7 @@ pipeline {
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 60dff9cf6..067fc7920 100644
--- a/dev/format_all.py
+++ b/dev/format_all.py
@@ -26,6 +26,5 @@ if __name__ == "__main__":
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 b9b3c3421..6b4658856 100644
--- a/dev/format_check.py
+++ b/dev/format_check.py
@@ -32,32 +32,30 @@ FILTERED_LINES = [
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 fc95fa737..563ef8df3 100644
--- a/dev/format_lib.py
+++ b/dev/format_lib.py
@@ -21,12 +21,15 @@ import subprocess
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