Forráskód Böngészése

Merge pull request #999 from jelmer/flake8

Fix issues with newer flake8
Jelmer Vernooij 2 éve
szülő
commit
d64c71ee50
6 módosított fájl, 14 hozzáadás és 14 törlés
  1. 1 1
      .flake8
  2. 1 1
      .github/workflows/pythonpackage.yml
  3. 3 3
      docs/conf.py
  4. 5 5
      dulwich/repo.py
  5. 1 1
      dulwich/tests/compat/test_porcelain.py
  6. 3 3
      setup.py

+ 1 - 1
.flake8

@@ -1,5 +1,5 @@
 [flake8]
-extend-ignore = E203, E266, E501, W293, W291
+extend-ignore = E203, E266, E501, W293, W291, W503
 max-line-length = 88
 max-complexity = 18
 select = B,C,E,F,W,T4,B9

+ 1 - 1
.github/workflows/pythonpackage.yml

@@ -38,7 +38,7 @@ jobs:
     - name: Install dependencies
       run: |
         python -m pip install --upgrade pip
-        pip install -U pip coverage flake8==4.0.1 fastimport paramiko urllib3
+        pip install -U pip coverage flake8 fastimport paramiko urllib3
     - name: Install gpg on supported platforms
       run: pip install -U gpg
       if: "matrix.os != 'windows-latest' && matrix.python-version != 'pypy3'"

+ 3 - 3
docs/conf.py

@@ -31,7 +31,7 @@ extensions = [
     'sphinx.ext.ifconfig',
     'sphinx.ext.intersphinx',
     'sphinx.ext.napoleon',
-    ]
+]
 
 autoclass_content = "both"
 
@@ -186,8 +186,8 @@ htmlhelp_basename = 'dulwichdoc'
 # (source start file, target name, title, author, documentclass
 # [howto/manual]).
 latex_documents = [
-  ('index', 'dulwich.tex', u'dulwich Documentation',
-   u'Jelmer Vernooij', 'manual'),
+    ('index', 'dulwich.tex', u'dulwich Documentation',
+     'Jelmer Vernooij', 'manual'),
 ]
 
 # The name of an image file (relative to this directory) to place at the top of

+ 5 - 5
dulwich/repo.py

@@ -1065,11 +1065,11 @@ class Repo(BaseRepo):
     ) -> None:
         hidden_path = os.path.join(root, CONTROLDIR)
         if bare is None:
-            if (os.path.isfile(hidden_path) or
-                    os.path.isdir(os.path.join(hidden_path, OBJECTDIR))):
+            if (os.path.isfile(hidden_path)
+                    or os.path.isdir(os.path.join(hidden_path, OBJECTDIR))):
                 bare = False
-            elif (os.path.isdir(os.path.join(root, OBJECTDIR)) and
-                    os.path.isdir(os.path.join(root, REFSDIR))):
+            elif (os.path.isdir(os.path.join(root, OBJECTDIR))
+                    and os.path.isdir(os.path.join(root, REFSDIR))):
                 bare = True
             else:
                 raise NotGitRepository(
@@ -1356,7 +1356,7 @@ class Repo(BaseRepo):
         from dulwich.index import (
             IndexEntry,
             _fs_to_tree_path,
-            )
+        )
 
         index = self.open_index()
         try:

+ 1 - 1
dulwich/tests/compat/test_porcelain.py

@@ -94,7 +94,7 @@ class TagCreateSignTestCase(PorcelainGpgTestCase, CompatTestCase):
                 'GNUPGHOME': os.environ['GNUPGHOME'],
                 'GIT_COMMITTER_NAME': 'Joe Example',
                 'GIT_COMMITTER_EMAIL': 'joe@example.com',
-                },
+            },
         )
         tag = self.repo[b"refs/tags/verifyme"]
         self.assertNotEqual(tag.signature, None)

+ 3 - 3
setup.py

@@ -53,8 +53,8 @@ if sys.platform == 'darwin' and os.path.exists('/usr/bin/xcodebuild'):
     for line in out.splitlines():
         line = line.decode("utf8")
         # Also parse only first digit, because 3.2.1 can't be parsed nicely
-        if (line.startswith('Xcode') and
-                int(line.split()[1].split('.')[0]) >= 4):
+        if (line.startswith('Xcode')
+                and int(line.split()[1].split('.')[0]) >= 4):
             os.environ['ARCHFLAGS'] = ''
 
 tests_require = ['fastimport']
@@ -79,7 +79,7 @@ if has_setuptools:
         'https': ['urllib3>=1.24.1'],
         'pgp': ['gpg'],
         'paramiko': ['paramiko'],
-        }
+    }
     setup_kwargs['install_requires'] = ['urllib3>=1.24.1', 'certifi']
     setup_kwargs['include_package_data'] = True
     setup_kwargs['test_suite'] = 'dulwich.tests.test_suite'