From 32f00908884351c48d2dc1c14c7b84d2e08f70bf Mon Sep 17 00:00:00 2001 From: Jean-Michel Picod Date: Tue, 28 Apr 2020 18:24:46 +0200 Subject: [PATCH 1/9] Try to fix yapf matcher --- .github/python_matcher.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/python_matcher.json b/.github/python_matcher.json index ac38ab7..6532ac3 100644 --- a/.github/python_matcher.json +++ b/.github/python_matcher.json @@ -4,7 +4,7 @@ "owner": "yapf-diff", "pattern": [ { - "regexp": "^[+-]{3}\\s*([^\\s]*)\\s*\\((original|reformatted)\\)$", + "regexp": "^(?:---|\\+\\+\\+)\\s*([^\\s]*)\\s*\\((?:original|reformatted)\\)$", "file": 1 }, { @@ -13,7 +13,7 @@ "column": 2 }, { - "regexp": "^(\\s|\\+[^+]|\\-[^-]).*$", + "regexp": "^((?:\\s|\\+[^+]|\\-[^-]).*)$", "loop": true, "message": 1 } From a6114964971666aca91161769149d0b2873eef98 Mon Sep 17 00:00:00 2001 From: Jean-Michel Picod Date: Tue, 28 Apr 2020 18:27:05 +0200 Subject: [PATCH 2/9] Force format error to test yapf matcher --- deploy.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/deploy.py b/deploy.py index bb1c056..6b8377d 100755 --- a/deploy.py +++ b/deploy.py @@ -302,8 +302,7 @@ class OpenSKInstaller: # Need to update self.checked_command_output( ["rustup", "install", target_toolchain_fullstring]) - self.checked_command_output( - ["rustup", "target", "add", SUPPORTED_BOARDS[self.args.board].arch]) + self.checked_command_output(["rustup", "target", "add", SUPPORTED_BOARDS[self.args.board].arch]) info("Rust toolchain up-to-date") def build_tockos(self): From 332d7bc2ea775dccdd481a150e403e674d8efa23 Mon Sep 17 00:00:00 2001 From: Jean-Michel Picod Date: Tue, 28 Apr 2020 18:36:04 +0200 Subject: [PATCH 3/9] Update yapf matcher. Extracting the diff is not very useful because messages are not concatenated. The line/column info is also not useful because the diff includes some context lines. --- .github/python_matcher.json | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/python_matcher.json b/.github/python_matcher.json index 6532ac3..d66fea8 100644 --- a/.github/python_matcher.json +++ b/.github/python_matcher.json @@ -5,17 +5,8 @@ "pattern": [ { "regexp": "^(?:---|\\+\\+\\+)\\s*([^\\s]*)\\s*\\((?:original|reformatted)\\)$", - "file": 1 - }, - { - "regexp": "^@@\\s*-(\\d+),(\\d+)\\s*\\+(\\d+),(\\d+)\\s*@@$", - "line": 1, - "column": 2 - }, - { - "regexp": "^((?:\\s|\\+[^+]|\\-[^-]).*)$", - "loop": true, - "message": 1 + "file": 1, + "message": "This file needs formating." } ] }, From 2e35d0074a67ec56112e5362bd829a542bc1334a Mon Sep 17 00:00:00 2001 From: Jean-Michel Picod Date: Wed, 29 Apr 2020 11:05:28 +0200 Subject: [PATCH 4/9] Introduce formatting error to test yapf --- deploy.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deploy.py b/deploy.py index 6b8377d..c480656 100755 --- a/deploy.py +++ b/deploy.py @@ -302,7 +302,8 @@ class OpenSKInstaller: # Need to update self.checked_command_output( ["rustup", "install", target_toolchain_fullstring]) - self.checked_command_output(["rustup", "target", "add", SUPPORTED_BOARDS[self.args.board].arch]) + self.checked_command_output( + ["rustup", "target", "add", SUPPORTED_BOARDS[self.args.board].arch]) info("Rust toolchain up-to-date") def build_tockos(self): @@ -314,7 +315,8 @@ class OpenSKInstaller: self.checked_command_output(["make"], cwd=props.path) def build_example(self): - info("Building example {}".format(self.args.application)) + info( + "Building example {}".format(self.args.application)) self._build_app_or_example(is_example=True) def build_opensk(self): From 674c4c1b9a3d19e43e13c63c627fa763ee77705e Mon Sep 17 00:00:00 2001 From: Jean-Michel Picod Date: Wed, 29 Apr 2020 11:38:33 +0200 Subject: [PATCH 5/9] Fixing yapf matcher --- .github/python_matcher.json | 13 ++++++++++--- deploy.py | 6 +++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/python_matcher.json b/.github/python_matcher.json index d66fea8..2778f15 100644 --- a/.github/python_matcher.json +++ b/.github/python_matcher.json @@ -4,9 +4,16 @@ "owner": "yapf-diff", "pattern": [ { - "regexp": "^(?:---|\\+\\+\\+)\\s*([^\\s]*)\\s*\\((?:original|reformatted)\\)$", - "file": 1, - "message": "This file needs formating." + "regexp": "^---\\s*([^\\s]*)\\s*\\(original\\)$", + "file": 1 + }, + { + "regexp": "^\\+\\+\\+\\s*([^\\s]*)\\s*\\(reformatted\\)$", + "message": 2 + }, + { + "regexp": "^@@\\s*-(\\d+),(\\d+)\\s*\\+(\\d+),(\\d+)\\s*@@$", + "line": 1 } ] }, diff --git a/deploy.py b/deploy.py index c480656..16276ca 100755 --- a/deploy.py +++ b/deploy.py @@ -315,8 +315,7 @@ class OpenSKInstaller: self.checked_command_output(["make"], cwd=props.path) def build_example(self): - info( - "Building example {}".format(self.args.application)) + info("Building example {}".format(self.args.application)) self._build_app_or_example(is_example=True) def build_opensk(self): @@ -343,7 +342,8 @@ class OpenSKInstaller: env["RUSTFLAGS"] = " ".join(rust_flags) command = [ - "cargo", "build", "--release", "--target={}".format(props.arch), + "cargo", + "build", "--release", "--target={}".format(props.arch), "--features={}".format(",".join(self.args.features)) ] if is_example: From 3e19c7512f12b24217ff5de8730eb74beb2dc93a Mon Sep 17 00:00:00 2001 From: Jean-Michel Picod Date: Wed, 29 Apr 2020 11:40:14 +0200 Subject: [PATCH 6/9] Fix missing parentheses in regexp --- .github/python_matcher.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/python_matcher.json b/.github/python_matcher.json index 2778f15..4c9a945 100644 --- a/.github/python_matcher.json +++ b/.github/python_matcher.json @@ -8,7 +8,7 @@ "file": 1 }, { - "regexp": "^\\+\\+\\+\\s*([^\\s]*)\\s*\\(reformatted\\)$", + "regexp": "^\\+\\+\\+\\s*([^\\s]*)\\s*\\((reformatted)\\)$", "message": 2 }, { From 8e182b9de91ff94898c7555aa126f271c0c473a3 Mon Sep 17 00:00:00 2001 From: Jean-Michel Picod Date: Wed, 29 Apr 2020 11:40:48 +0200 Subject: [PATCH 7/9] Introduce formatting mistake --- deploy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy.py b/deploy.py index 16276ca..93dbe7b 100755 --- a/deploy.py +++ b/deploy.py @@ -342,8 +342,8 @@ class OpenSKInstaller: env["RUSTFLAGS"] = " ".join(rust_flags) command = [ - "cargo", - "build", "--release", "--target={}".format(props.arch), + "cargo", "build", + "--release", "--target={}".format(props.arch), "--features={}".format(",".join(self.args.features)) ] if is_example: From 8211df81d5cbf5b4c0902622be2675626a151132 Mon Sep 17 00:00:00 2001 From: Jean-Michel Picod Date: Wed, 29 Apr 2020 11:46:52 +0200 Subject: [PATCH 8/9] Adjust regexp --- .github/python_matcher.json | 2 +- deploy.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/python_matcher.json b/.github/python_matcher.json index 4c9a945..6c99675 100644 --- a/.github/python_matcher.json +++ b/.github/python_matcher.json @@ -8,7 +8,7 @@ "file": 1 }, { - "regexp": "^\\+\\+\\+\\s*([^\\s]*)\\s*\\((reformatted)\\)$", + "regexp": "^\\+\\+\\+\\s*([^\\s]*)\\s*\\((.*)\\)$", "message": 2 }, { diff --git a/deploy.py b/deploy.py index 93dbe7b..16276ca 100755 --- a/deploy.py +++ b/deploy.py @@ -342,8 +342,8 @@ class OpenSKInstaller: env["RUSTFLAGS"] = " ".join(rust_flags) command = [ - "cargo", "build", - "--release", "--target={}".format(props.arch), + "cargo", + "build", "--release", "--target={}".format(props.arch), "--features={}".format(",".join(self.args.features)) ] if is_example: From ca15ea43235f06bc58a70833c28e8bb461938425 Mon Sep 17 00:00:00 2001 From: Jean-Michel Picod Date: Wed, 29 Apr 2020 11:48:12 +0200 Subject: [PATCH 9/9] Fix formatting --- deploy.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/deploy.py b/deploy.py index 16276ca..bb1c056 100755 --- a/deploy.py +++ b/deploy.py @@ -342,8 +342,7 @@ class OpenSKInstaller: env["RUSTFLAGS"] = " ".join(rust_flags) command = [ - "cargo", - "build", "--release", "--target={}".format(props.arch), + "cargo", "build", "--release", "--target={}".format(props.arch), "--features={}".format(",".join(self.args.features)) ] if is_example: