[Git][reproducible-builds/diffoscope][master] 4 commits: Clarify use of a "null" diff in order to remember an exit code.

Chris Lamb gitlab at salsa.debian.org
Tue Jul 7 10:41:42 UTC 2020



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
1dbc0d63 by Chris Lamb at 2020-07-07T11:31:10+01:00
Clarify use of a "null" diff in order to remember an exit code.

- - - - -
a76b0f17 by Chris Lamb at 2020-07-07T11:32:10+01:00
Clarify the use of an seperate "NullChanges" file to represent missing data in the Debian package comparator.

- - - - -
e3498602 by Chris Lamb at 2020-07-07T11:32:45+01:00
Don't alias a variable when don't end up it; use "_" instead.

- - - - -
f944678d by Chris Lamb at 2020-07-07T11:33:03+01:00
sanity -> coherence.

- - - - -


4 changed files:

- diffoscope/comparators/debian.py
- diffoscope/main.py
- tests/comparators/test_cbfs.py
- tests/comparators/test_utils.py


Changes:

=====================================
diffoscope/comparators/debian.py
=====================================
@@ -130,11 +130,11 @@ class DebControlFile(File):
         if isinstance(file, DebControlFile):
             return file._deb822
 
-        class DummyChanges(dict):
+        class NullChanges(dict):
             def get_as_string(self, _):
                 return ""
 
-        return DummyChanges(Files=[], Version="")
+        return NullChanges(Files=[], Version="")
 
     @staticmethod
     def _parse_gpg(file):


=====================================
diffoscope/main.py
=====================================
@@ -696,7 +696,7 @@ def run_diffoscope(parsed_args):
             with profile("main", "outputs"):
                 difference = compare_root_paths(path1, path2)
         ProgressManager().finish()
-    # Generate an empty, dummy diff to write, saving the exit code first.
+    # Generate an empty, null diff to write, saving the exit code first.
     has_differences = bool(difference is not None)
     if difference is None and parsed_args.output_empty:
         difference = Difference(None, path1, path2)


=====================================
tests/comparators/test_cbfs.py
=====================================
@@ -126,7 +126,7 @@ def test_listing(differences):
     #
     # As the output of this command keeps changing slightly (see
     # https://salsa.debian.org/reproducible-builds/diffoscope/merge_requests/38/
-    # and the git log of this file), perform only these basic sanity checks.
+    # and the git log of this file), perform only these basic coherence check.
 
     assert differences[0].source1.startswith("cbfstool")
     assert re.search(r"\+text\s.*\sraw\s", differences[0].unified_diff)


=====================================
tests/comparators/test_utils.py
=====================================
@@ -123,7 +123,7 @@ def test_trim_stderr_in_command():
             r, w = os.fdopen(r), os.fdopen(w, "w")
 
             def write():
-                for dummy in range(0, Command.MAX_STDERR_LINES + 1):
+                for _ in range(0, Command.MAX_STDERR_LINES + 1):
                     w.write("error {}\n".format(self.path))
 
             threading.Thread(target=write).start()



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/22d64eb6b22c6867de7fb1a864c0194226720793...f944678d54ba6ac61bc7eb56419a6ea46b13298c

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/22d64eb6b22c6867de7fb1a864c0194226720793...f944678d54ba6ac61bc7eb56419a6ea46b13298c
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20200707/0e0b11bb/attachment.htm>


More information about the rb-commits mailing list