From bcba3baf603f0663944d529b2a41ae8b7ad9a938 Mon Sep 17 00:00:00 2001 From: Llewellyn Falco Date: Sun, 28 Apr 2024 17:23:02 +0000 Subject: [PATCH] - B fix issue in Cyber-dojo issue is that in cyber dojo it is doing a shallow compare and the Shallow compare ERRONEOUSLY shows that files match Co-Authored-By: Nitsan Avni Co-Authored-By: 4dsherwood <4dsherwood@users.noreply.github.com> --- TODO.md | 15 ++++++++++++++- approvaltests/file_approver.py | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index f0be5547..4603aa5e 100644 --- a/TODO.md +++ b/TODO.md @@ -18,6 +18,18 @@ Rotate on green was designed for git handoff, each commit is green Ping-Pong Pairing Try to make the smallest change possible, then rotate +Support inline on CyberDojo +IF it is in CyberDojo AND inline approvals, + THEN we need to do a deep compare + +how could we fix this? +option 1: we can use the automatic approver + not there is a bug in the automatic approver +option 2: Llewellyns idea + +POssible FEATURE +Create an API to add a REPORTER. + now we have a combined reporter and then ?? only the last one works? Inline Approvals Bugs 1. [ ] rename all of the reporters to start with the word report @@ -38,7 +50,8 @@ Inline Approvals Bugs 6. [ ] some relationship between the output formatter and the parser 7. [X ] Move explainations to ApprovalTests.Documentation Please note: we found this broken link [Capture .received. files from CI] -8. * [ ] this link: [Capture .received. files from CI](https://github.com/approvals/ApprovalTests.Java/blob/master/approvaltests/docs/explanations/how_to/CaptureFilesFromCI.md) +8. * [ ] this link: + * [Capture .received. files from CI](https://github.com/approvals/ApprovalTests.Java/blob/master/approvaltests/docs/explanations/how_to/CaptureFilesFromCI.md) diff --git a/approvaltests/file_approver.py b/approvaltests/file_approver.py index fb6342eb..28c94f61 100644 --- a/approvaltests/file_approver.py +++ b/approvaltests/file_approver.py @@ -23,7 +23,7 @@ class FileComparator(Comparator): def compare(self, received_path: str, approved_path: str) -> bool: if not exists(approved_path) or not exists(received_path): return False - if filecmp.cmp(approved_path, received_path): + if filecmp.cmp(approved_path, received_path, shallow=False): return True try: approved_raw = pathlib.Path(approved_path).read_text()