#4864 Adjust pagure's source code for the newer flake8
Merged 3 years ago by pingou. Opened 3 years ago by pingou.

file modified
+1 -1
@@ -1,3 +1,3 @@ 

  [flake8]

- ignore = W503,E203

+ ignore = W503,E203,E902

  exclude = pagure/hooks/files/git_multimail_upstream.py

file modified
+1 -1
@@ -33,7 +33,7 @@ 

  import pagure.lib.query  # noqa: E402

  import pagure.lib.tasks  # noqa: E402

  from pagure.config import config as pagure_config  # noqa: E402

- from pagure.doc_utils import (

+ from pagure.doc_utils import (  # noqa: E402

      load_doc_title_and_name,

      modify_rst,

      modify_html,

file modified
+4 -4
@@ -704,11 +704,11 @@ 

          of lines as returned by _process_project.

          """

          repos = []

-         for l in lines:

-             if l.startswith("repo "):

-                 repos.append([l])

+         for line in lines:

+             if line.startswith("repo "):

+                 repos.append([line])

              else:

-                 repos[-1].append(l)

+                 repos[-1].append(line)

          for i, repo_lines in enumerate(repos):

              repos[i] = "\n".join(repo_lines)

          return repos

file modified
+6 -1
@@ -374,7 +374,12 @@ 

                      "%(comment)s"

                      "</div>"

                      "</section>"

-                     "</div></div>"

+                     "</div>"

+                     '<div class="card-footer bg-transparent d-flex '

+                     'align-items-center border-0 p-0">'

+                     "%(templ_edited)s"

+                     "</div>"

+                     "</div>"

                      "</td></tr>"

                      % (

                          {

file modified
+1 -1
@@ -847,7 +847,7 @@ 

              fromref=branchname,

          )

          if log.strip():

-             log = [l.split(" ", 1) for l in log.strip().split("\n")]

+             log = [line.split(" ", 1) for line in log.strip().split("\n")]

          else:

              log = []

      except Exception:

file modified
+1 -1
@@ -41,7 +41,7 @@ 

              sys.executable,

              "-m",

              "flake8",

-             "--ignore=E712,W503,E203",

+             "--ignore=E712,W503,E203,E902",

              REPO_PATH,

          ]

  

Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr

Why is this commented out?

Surprisingly it's not being used (and not flake8 complains about it)
It needs to be fixed but I don't have the time to do it right now (so I'm building a little tech debt here..)

rebased onto 516f4209f54d520a69742a7815f889f812e38d64

3 years ago

rebased onto 23e31d1cb692c90cb501ac396984a98b387b4adb

3 years ago

So I suspect this won't pass because the E902 which is set to be ignored in the .flake8 file is likely not being take into account before this PR gets in

Ah, no, we list the error/warnings to ignore in another place

rebased onto a6b52c1

3 years ago

Pull-Request has been merged by pingou

3 years ago