[diffoscope] 02/02: comparators/java: wrap some lines

Mattia Rizzolo mattia at debian.org
Mon Feb 5 19:50:19 CET 2018


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to branch master
in repository diffoscope.

commit b7332b6b37c3e9ddea01e512e199c9602a39fe94
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Mon Feb 5 19:43:01 2018 +0100

    comparators/java: wrap some lines
    
    Gbp-Dch: Ignore
    Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
 diffoscope/comparators/java.py | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/diffoscope/comparators/java.py b/diffoscope/comparators/java.py
index 23cd996..f44d740 100644
--- a/diffoscope/comparators/java.py
+++ b/diffoscope/comparators/java.py
@@ -54,10 +54,21 @@ class Javap(Command):
 
     @tool_required('javap')
     def cmdline(self):
-        return ['javap', '-verbose', '-constants', '-s', '-l', '-private', self.path]
+        return [
+            'javap',
+            '-verbose',
+            '-constants',
+            '-s',
+            '-l',
+            '-private',
+            self.path
+        ]
 
     def filter(self, line):
-        if re.match(r'^(Classfile %s$|  Last modified |  MD5 checksum )' % re.escape(self.real_path), line.decode('utf-8')):
+        regex = r'^(Classfile {}$|  Last modified |  MD5 checksum )'.format(
+            re.escape(self.real_path)
+        )
+        if re.match(regex, line.decode('utf-8')):
             return b''
         return line
 
@@ -72,9 +83,9 @@ class ClassFile(File):
 
         for decompiler in self.decompilers:
             try:
-                diff = [Difference.from_command(decompiler,
-                                                self.path,
-                                                other.path)]
+                diff = [
+                    Difference.from_command(decompiler, self.path, other.path)
+                ]
                 if diff:
                     break
             except RequiredToolNotFound:
@@ -85,4 +96,3 @@ class ClassFile(File):
             raise RequiredToolNotFound(self.decompilers[-1])
 
         return diff
-

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list