From 164a5774fe4152f6dc2e69219f47421849e4701b Mon Sep 17 00:00:00 2001
From: Pierre-Yves Chibon <pingou@pingoured.fr>
Date: Jul 09 2015 08:24:14 +0000
Subject: [PATCH 1/2] Project wide pylint clean up


---

diff --git a/pagure/__init__.py b/pagure/__init__.py
index 1799d0b..66b2230 100644
--- a/pagure/__init__.py
+++ b/pagure/__init__.py
@@ -26,7 +26,7 @@ from logging.handlers import SMTPHandler
 import flask
 import pygit2
 import redis
-from flask_fas_openid import FAS
+from pagure.flask_fas_openid import FAS
 from functools import wraps
 from sqlalchemy.exc import SQLAlchemyError
 
@@ -54,7 +54,7 @@ if 'PAGURE_CONFIG' in os.environ:
 
 FAS = FAS(APP)
 SESSION = pagure.lib.create_session(APP.config['DB_URL'])
-REDIS=None
+REDIS = None
 if APP.config['EVENTSOURCE_SOURCE']:
     POOL = redis.ConnectionPool(
         host=APP.config['REDIS_HOST'],
@@ -69,9 +69,9 @@ if not APP.debug:
     ))
 
 # Send classic logs into syslog
-handler = logging.StreamHandler()
-handler.setLevel(APP.config.get('log_level', 'INFO'))
-APP.logger.addHandler(handler)
+SHANDLER = logging.StreamHandler()
+SHANDLER.setLevel(APP.config.get('log_level', 'INFO'))
+APP.logger.addHandler(SHANDLER)
 
 LOG = APP.logger
 
diff --git a/pagure/docs_server.py b/pagure/docs_server.py
index 45e55bd..90da7fd 100644
--- a/pagure/docs_server.py
+++ b/pagure/docs_server.py
@@ -37,9 +37,9 @@ if not APP.debug:
     ))
 
 # Send classic logs into syslog
-handler = logging.StreamHandler()
-handler.setLevel(APP.config.get('log_level', 'INFO'))
-APP.logger.addHandler(handler)
+SHANDLER = logging.StreamHandler()
+SHANDLER.setLevel(APP.config.get('log_level', 'INFO'))
+APP.logger.addHandler(SHANDLER)
 
 LOG = APP.logger
 
@@ -107,11 +107,13 @@ def markdown_filter(text):
 # Placeholder to allow re-using pagure's templates
 @APP.route('/')
 def index():
+    ''' Redirects to the front page of this pagure instance. '''
     return flask.redirect(APP.config['APP_URL'])
 
 
 @APP.route('/users/')
 def view_users():
+    ''' Redirects to the list of users on this pagure instance. '''
     root_url = APP.config['APP_URL']
     if root_url.endswith('/'):
         root_url = root_url[:-1]
@@ -120,6 +122,7 @@ def view_users():
 
 @APP.route('/groups/')
 def group_lists():
+    ''' Redirects to the list of groups on this pagure instance. '''
     root_url = APP.config['APP_URL']
     if root_url.endswith('/'):
         root_url = root_url[:-1]
@@ -128,6 +131,9 @@ def group_lists():
 
 @APP.route('/new/')
 def new_project():
+    ''' Redirects to the page to create a new project on this pagure
+    instance.
+    '''
     root_url = APP.config['APP_URL']
     if root_url.endswith('/'):
         root_url = root_url[:-1]
@@ -137,6 +143,7 @@ def new_project():
 @APP.route('/repo/<repo>/')
 @APP.route('/repo/fork/<username>/<repo>/')
 def view_repo(repo, username=None):
+    ''' Redirects to the overview page of this project. '''
     root_url = APP.config['APP_URL']
     if root_url.endswith('/'):
         root_url = root_url[:-1]
@@ -147,6 +154,7 @@ def view_repo(repo, username=None):
 @APP.route('/<repo>/issues/')
 @APP.route('/fork/<username>/<repo>/issues/')
 def view_issues(repo, username=None):
+    ''' Redirects to the page listing all issues of this project. '''
     root_url = APP.config['APP_URL']
     if root_url.endswith('/'):
         root_url = root_url[:-1]
@@ -159,6 +167,7 @@ def view_issues(repo, username=None):
 @APP.route('/<repo>/commits/')
 @APP.route('/fork/<username>/<repo>/commits/')
 def view_commits(repo, username=None):
+    ''' Redirects to the page listing all commits of this project. '''
     root_url = APP.config['APP_URL']
     if root_url.endswith('/'):
         root_url = root_url[:-1]
@@ -171,6 +180,8 @@ def view_commits(repo, username=None):
 @APP.route('/<repo>/tree/')
 @APP.route('/fork/<username>/<repo>/tree/')
 def view_tree(repo, username=None):
+    ''' Redirects to the page displaying the tree of files of this project.
+    '''
     root_url = APP.config['APP_URL']
     if root_url.endswith('/'):
         root_url = root_url[:-1]
@@ -183,6 +194,7 @@ def view_tree(repo, username=None):
 @APP.route('/<repo>/tags/')
 @APP.route('/fork/<username>/<repo>/tags/')
 def view_tags(repo, username=None):
+    ''' Redirects to the page listing all tags of this project. '''
     root_url = APP.config['APP_URL']
     if root_url.endswith('/'):
         root_url = root_url[:-1]
@@ -195,6 +207,7 @@ def view_tags(repo, username=None):
 @APP.route('/<repo>/pull-requests/')
 @APP.route('/fork/<username>/<repo>/pull-requests/')
 def request_pulls(repo, username=None):
+    ''' Redirects to the page listing all pull-requests of this project. '''
     root_url = APP.config['APP_URL']
     if root_url.endswith('/'):
         root_url = root_url[:-1]
@@ -207,6 +220,7 @@ def request_pulls(repo, username=None):
 @APP.route('/<repo>/forks/')
 @APP.route('/fork/<username>/<repo>/forks/')
 def view_forks(repo, username=None):
+    ''' Redirects to the page listing all forks of this project. '''
     root_url = APP.config['APP_URL']
     if root_url.endswith('/'):
         root_url = root_url[:-1]
diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py
index f2c2b8a..91615aa 100644
--- a/pagure/lib/__init__.py
+++ b/pagure/lib/__init__.py
@@ -269,7 +269,7 @@ def add_tag_obj(session, obj, tags, user, ticketfolder, redis=None):
 
 
 def add_issue_assignee(session, issue, assignee, user, ticketfolder,
-                      redis=None):
+                       redis=None):
     ''' Add an assignee to an issue, in other words, assigned an issue. '''
     user_obj = __get_user(session, user)
 
@@ -812,7 +812,7 @@ def add_pull_request_flag(session, request, username, percent, comment, url,
 
 def new_project(session, user, name, blacklist,
                 gitfolder, docfolder, ticketfolder, requestfolder,
-                description=None, url=None,avatar_email=None,
+                description=None, url=None, avatar_email=None,
                 parent_id=None):
     ''' Create a new project based on the information provided.
     '''
@@ -1785,7 +1785,8 @@ def update_user_ssh(session, user, ssh_key):
 
     message = 'Nothing to update'
 
-    ssh_key = ssh_key.strip().replace('\n', '') if ssh_key and ssh_key.strip() else None
+    ssh_key = ssh_key.strip().replace('\n', '') \
+              if ssh_key and ssh_key.strip() else None
 
     if ssh_key != user.public_ssh_key:
         user.public_ssh_key = ssh_key
diff --git a/pagure/lib/git.py b/pagure/lib/git.py
index 8ba63af..a9f3a5b 100644
--- a/pagure/lib/git.py
+++ b/pagure/lib/git.py
@@ -150,8 +150,9 @@ def update_git(obj, repo, repofolder, objtype='ticket'):
 
     # Write down what changed
     with open(file_path, 'w') as stream:
-        stream.write(json.dumps(obj.to_json(),
-                     sort_keys=True, indent=4, separators=(',', ': ')))
+        stream.write(json.dumps(
+            obj.to_json(), sort_keys=True, indent=4,
+            separators=(',', ': ')))
 
     # Retrieve the list of files that changed
     diff = new_repo.diff()
@@ -231,8 +232,6 @@ def clean_git(obj, repo, repofolder, objtype='ticket'):
     # Remove the file
     os.unlink(file_path)
 
-    diff = new_repo.diff()
-
     # Add the changes to the index
     index.remove(obj.uid)
 
@@ -756,15 +755,15 @@ def read_output(cmd, abspath, input=None, keepends=False, **kw):
         stdin = subprocess.PIPE
     else:
         stdin = None
-    p = subprocess.Popen(
+    procs = subprocess.Popen(
         cmd,
         stdin=stdin,
         stdout=subprocess.PIPE,
         stderr=subprocess.PIPE,
         cwd=abspath,
         **kw)
-    (out, err) = p.communicate(input)
-    retcode = p.wait()
+    (out, err) = procs.communicate(input)
+    retcode = procs.wait()
     if retcode:
         print 'ERROR: %s =-- %s' % (cmd, retcode)
         print out
diff --git a/pagure/lib/model.py b/pagure/lib/model.py
index 64887a1..9a2e53d 100644
--- a/pagure/lib/model.py
+++ b/pagure/lib/model.py
@@ -373,8 +373,8 @@ class Project(BASE):
             'id': self.id,
             'name': self.name,
             'description': self.description,
-            'parent': self.parent.to_json(public=public, api=api)
-            if self.parent else None,
+            'parent': self.parent.to_json(
+                public=public, api=api) if self.parent else None,
             'date_created': self.date_created.strftime('%s'),
             'user': self.user.to_json(public=public),
         }
@@ -509,8 +509,8 @@ class Issue(BASE):
             'tags': self.tags_text,
             'depends': [str(item) for item in self.depends_text],
             'blocks': [str(item) for item in self.blocks_text],
-            'assignee': self.assignee.to_json(public=public)
-            if self.assignee else None,
+            'assignee': self.assignee.to_json(
+                public=public) if self.assignee else None,
         }
 
         comments = []
@@ -601,12 +601,12 @@ class IssueComment(BASE):
 
         '''
         output = {
-                'id': self.id,
-                'comment': self.comment,
-                'parent': self.parent_id,
-                'date_created': self.date_created.strftime('%s'),
-                'user': self.user.to_json(public=public),
-            }
+            'id': self.id,
+            'comment': self.comment,
+            'parent': self.parent_id,
+            'date_created': self.date_created.strftime('%s'),
+            'user': self.user.to_json(public=public),
+        }
         return output
 
 
@@ -826,13 +826,13 @@ class PullRequest(BASE):
             'repo_from': self.project_from.to_json(public=public, api=api),
             'date_created': self.date_created.strftime('%s'),
             'user': self.user.to_json(public=public),
-            'assignee': self.assignee.to_json(public=public)
-            if self.assignee else None,
+            'assignee': self.assignee.to_json(
+                public=public) if self.assignee else None,
             'status': self.status,
             'commit_start': self.commit_start,
             'commit_stop': self.commit_stop,
-            'closed_by': self.closed_by.to_json(public=public)
-            if self.closed_by else None,
+            'closed_by': self.closed_by.to_json(
+                public=public) if self.closed_by else None,
         }
 
         comments = []
diff --git a/pagure/ui/fork.py b/pagure/ui/fork.py
index 7eb2491..7775763 100644
--- a/pagure/ui/fork.py
+++ b/pagure/ui/fork.py
@@ -224,10 +224,10 @@ def request_pull_patch(repo, requestid, username=None):
                 break
     else:
         try:
-            diff_commits, diff = pagure.lib.git.diff_pull_request(
+            diff_commits = pagure.lib.git.diff_pull_request(
                 SESSION, request, repo_obj, orig_repo,
                 requestfolder=APP.config['REQUESTS_FOLDER'],
-                with_diff=False)
+                with_diff=False)[0]
         except pagure.exceptions.PagureException as err:
             flask.flash(err.message, 'error')
             return flask.redirect(flask.url_for(
@@ -697,7 +697,7 @@ def new_request_pull(repo, branch_to, branch_from, username=None):
         return flask.redirect(flask.url_for(
             'view_repo', username=username, repo=repo.name))
 
-    repo_admin=is_repo_admin(repo)
+    repo_admin = is_repo_admin(repo)
 
     form = pagure.forms.RequestPullForm()
     if form.validate_on_submit() and repo_admin:
diff --git a/pagure/ui/issues.py b/pagure/ui/issues.py
index ca6021f..909b524 100644
--- a/pagure/ui/issues.py
+++ b/pagure/ui/issues.py
@@ -21,7 +21,7 @@ import mimetypes
 import pagure.doc_utils
 import pagure.lib
 import pagure.forms
-from pagure import (APP,  SESSION, REDIS, LOG, __get_file_in_tree,
+from pagure import (APP, SESSION, REDIS, LOG, __get_file_in_tree,
                     cla_required, is_repo_admin, authenticated)
 
 

From e1497f5e98387fa547e251ccf02ba179adc95202 Mon Sep 17 00:00:00 2001
From: Pierre-Yves Chibon <pingou@pingoured.fr>
Date: Jul 09 2015 08:32:08 +0000
Subject: [PATCH 2/2] Project wide pep8 clean up


---

diff --git a/pagure/api/fork.py b/pagure/api/fork.py
index 9a0adba..436443c 100644
--- a/pagure/api/fork.py
+++ b/pagure/api/fork.py
@@ -39,20 +39,20 @@ def api_pull_request_views(repo, username=None):
     Parameters
     ^^^^^^^^^^
 
-    +----------------+-----------+---------------+-----------------------------+
-    | Key            | Type      | Optionality   | Description                 |
-    +================+===========+===============+=============================+
-    | ``status``     | boolean   | Optional      | | Filter the status of      |
-    |                |           |               |   pull requests. Default:   |
-    |                |           |               |   ``True`` (opened pull     |
-    |                |           |               |   requests)                 |
-    +----------------+-----------+---------------+-----------------------------+
-    | ``assignee``   | string    | Optional      | | Filter the assignee of    |
-    |                |           |               |   pull requests             |
-    +----------------+-----------+---------------+-----------------------------+
-    | ``author``     | string    | Optional      | | Filter the author of      |
-    |                |           |               |   pull requests             |
-    +----------------+-----------+---------------+-----------------------------+
+    +---------------+----------+--------------+----------------------------+
+    | Key           | Type     | Optionality  | Description                |
+    +===============+==========+==============+============================+
+    | ``status``    | boolean  | Optional     | | Filter the status of     |
+    |               |          |              |   pull requests. Default:  |
+    |               |          |              |   ``True`` (opened pull    |
+    |               |          |              |   requests)                |
+    +---------------+----------+--------------+----------------------------+
+    | ``assignee``  | string   | Optional     | | Filter the assignee of   |
+    |               |          |              |   pull requests            |
+    +---------------+----------+--------------+----------------------------+
+    | ``author``    | string   | Optional     | | Filter the author of     |
+    |               |          |              |   pull requests            |
+    +---------------+----------+--------------+----------------------------+
 
     Sample response
     ^^^^^^^^^^^^^^^
@@ -404,25 +404,25 @@ def api_pull_request_add_comment(repo, requestid, username=None):
     Input
     ^^^^^
 
-    +----------------+----------+---------------+------------------------------+
-    | Key            | Type     | Optionality   | Description                  |
-    +================+==========+===============+==============================+
-    | ``comment``    | string   | Mandatory     | | The comment to add         |
-    |                |          |               |   to the pull request        |
-    +----------------+----------+---------------+------------------------------+
-    | ``commit``     | string   | Optional      | | The hash of the specific   |
-    |                |          |               |   commit you wish to         |
-    |                |          |               |   comment on                 |
-    +----------------+----------+---------------+------------------------------+
-    | ``filename``   | string   | Optional      | | The filename of the        |
-    |                |          |               |   specific file you wish     |
-    |                |          |               |   to comment on              |
-    +----------------+----------+---------------+------------------------------+
-    | ``row``        | int      | Optional      | | Used in combination        |
-    |                |          |               |   with filename to comment   |
-    |                |          |               |   on a specific row          |
-    |                |          |               |   of a file                  |
-    +----------------+----------+---------------+------------------------------+
+    +---------------+---------+--------------+-----------------------------+
+    | Key           | Type    | Optionality  | Description                 |
+    +===============+=========+==============+=============================+
+    | ``comment``   | string  | Mandatory    | | The comment to add        |
+    |               |         |              |   to the pull request       |
+    +---------------+---------+--------------+-----------------------------+
+    | ``commit``    | string  | Optional     | | The hash of the specific  |
+    |               |         |              |   commit you wish to        |
+    |               |         |              |   comment on                |
+    +---------------+---------+--------------+-----------------------------+
+    | ``filename``  | string  | Optional     | | The filename of the       |
+    |               |         |              |   specific file you wish    |
+    |               |         |              |   to comment on             |
+    +---------------+---------+--------------+-----------------------------+
+    | ``row``       | int     | Optional     | | Used in combination       |
+    |               |         |              |   with filename to comment  |
+    |               |         |              |   on a specific row         |
+    |               |         |              |   of a file                 |
+    +---------------+---------+--------------+-----------------------------+
 
     Sample response
     ^^^^^^^^^^^^^^^
@@ -511,44 +511,44 @@ def api_pull_request_add_flag(repo, requestid, username=None):
     Input
     ^^^^^
 
-    +----------------+----------+---------------+------------------------------+
-    | Key            | Type     | Optionality   | Description                  |
-    +================+==========+===============+==============================+
-    | ``username``   | string   | Mandatory     | | The name of the            |
-    |                |          |               |   application to be          |
-    |                |          |               |   presented to users         |
-    |                |          |               |   on the pull request page   |
-    +----------------+----------+---------------+------------------------------+
-    | ``percent``    | int      | Mandatory     | | A percentage of            |
-    |                |          |               |   completion compared to     |
-    |                |          |               |   the goal. The percentage   |
-    |                |          |               |   also determine the         |
-    |                |          |               |   background color of the    |
-    |                |          |               |   flag on the pull-request   |
-    |                |          |               |   page                       |
-    +----------------+----------+---------------+------------------------------+
-    | ``comment``    | string   | Mandatory     | | A short message            |
-    |                |          |               |   summarizing the            |
-    |                |          |               |   presented results          |
-    +----------------+----------+---------------+------------------------------+
-    | ``url``        | string   | Mandatory     | | A URL to the result        |
-    |                |          |               |   of this flag               |
-    +----------------+----------+---------------+------------------------------+
-    | ``uid``        | string   | Optional      | | A unique identifier used   |
-    |                |          |               |   to identify a flag on a    |
-    |                |          |               |   pull-request. If the       |
-    |                |          |               |   provided UID matches an    |
-    |                |          |               |   existing one, then the     |
-    |                |          |               |   API call will update the   |
-    |                |          |               |   existing one rather than   |
-    |                |          |               |   create a new one.          |
-    |                |          |               |   Maximum Length: 32         |
-    |                |          |               |   characters. Default: an    |
-    |                |          |               |   auto generated UID         |
-    +----------------+----------+---------------+------------------------------+
-    | ``commit``     | string   | Optional      | | The hash of the commit     |
-    |                |          |               |   you use                    |
-    +----------------+----------+---------------+------------------------------+
+    +---------------+---------+--------------+-----------------------------+
+    | Key           | Type    | Optionality  | Description                 |
+    +===============+=========+==============+=============================+
+    | ``username``  | string  | Mandatory    | | The name of the           |
+    |               |         |              |   application to be         |
+    |               |         |              |   presented to users        |
+    |               |         |              |   on the pull request page  |
+    +---------------+---------+--------------+-----------------------------+
+    | ``percent``   | int     | Mandatory    | | A percentage of           |
+    |               |         |              |   completion compared to    |
+    |               |         |              |   the goal. The percentage  |
+    |               |         |              |   also determine the        |
+    |               |         |              |   background color of the   |
+    |               |         |              |   flag on the pull-request  |
+    |               |         |              |   page                      |
+    +---------------+---------+--------------+-----------------------------+
+    | ``comment``   | string  | Mandatory    | | A short message           |
+    |               |         |              |   summarizing the           |
+    |               |         |              |   presented results         |
+    +---------------+---------+--------------+-----------------------------+
+    | ``url``       | string  | Mandatory    | | A URL to the result       |
+    |               |         |              |   of this flag              |
+    +---------------+---------+--------------+-----------------------------+
+    | ``uid``       | string  | Optional     | | A unique identifier used  |
+    |               |         |              |   to identify a flag on a   |
+    |               |         |              |   pull-request. If the      |
+    |               |         |              |   provided UID matches an   |
+    |               |         |              |   existing one, then the    |
+    |               |         |              |   API call will update the  |
+    |               |         |              |   existing one rather than  |
+    |               |         |              |   create a new one.         |
+    |               |         |              |   Maximum Length: 32        |
+    |               |         |              |   characters. Default: an   |
+    |               |         |              |   auto generated UID        |
+    +---------------+---------+--------------+-----------------------------+
+    | ``commit``    | string  | Optional     | | The hash of the commit    |
+    |               |         |              |   you use                   |
+    +---------------+---------+--------------+-----------------------------+
 
     Sample response
     ^^^^^^^^^^^^^^^
diff --git a/pagure/api/issue.py b/pagure/api/issue.py
index 32eba50..e88d5c7 100644
--- a/pagure/api/issue.py
+++ b/pagure/api/issue.py
@@ -42,18 +42,18 @@ def api_new_issue(repo, username=None):
     Input
     ^^^^^
 
-    +---------------+-----------+---------------+------------------------------+
-    | Key           | Type      | Optionality   | Description                  |
-    +===============+===========+===============+==============================+
-    | ``title``     | string    | Mandatory     | The title of the issue       |
-    +---------------+-----------+---------------+------------------------------+
-    | ``content``   | string    | Mandatory     | | The description of the     |
-    |               |           |               |   issue                      |
-    +---------------+-----------+---------------+------------------------------+
-    | ``private``   | boolean   | Optional      | | Include this key if        |
-    |               |           |               |   you want a private issue   |
-    |               |           |               |   to be created              |
-    +---------------+-----------+---------------+------------------------------+
+    +--------------+----------+--------------+-----------------------------+
+    | Key          | Type     | Optionality  | Description                 |
+    +==============+==========+==============+=============================+
+    | ``title``    | string   | Mandatory    | The title of the issue      |
+    +--------------+----------+--------------+-----------------------------+
+    | ``content``  | string   | Mandatory    | | The description of the    |
+    |              |          |              |   issue                     |
+    +--------------+----------+--------------+-----------------------------+
+    | ``private``  | boolean  | Optional     | | Include this key if       |
+    |              |          |              |   you want a private issue  |
+    |              |          |              |   to be created             |
+    +--------------+----------+--------------+-----------------------------+
 
     Sample response
     ^^^^^^^^^^^^^^^
@@ -156,27 +156,27 @@ def api_view_issues(repo, username=None):
     Parameters
     ^^^^^^^^^^
 
-    +----------------+----------+---------------+---------------------------+
-    | Key            | Type     | Optionality   | Description               |
-    +================+==========+===============+===========================+
-    | ``status``     | string   | Optional      | | Filters the status of   |
-    |                |          |               |   issues. Default:        |
-    |                |          |               |   ``Open``                |
-    +----------------+----------+---------------+---------------------------+
-    | ``tags``       | string   | Optional      | | A list of tags you      |
-    |                |          |               |   wish to filter. If      |
-    |                |          |               |   you want to filter      |
-    |                |          |               |   for issues not having   |
-    |                |          |               |   a tag, add an           |
-    |                |          |               |   exclamation mark in     |
-    |                |          |               |   front of it             |
-    +----------------+----------+---------------+---------------------------+
-    | ``assignee``   | string   | Optional      | | Filter the issues       |
-    |                |          |               |   by assignee             |
-    +----------------+----------+---------------+---------------------------+
-    | ``author``     | string   | Optional      | | Filter the issues       |
-    |                |          |               |   by creator              |
-    +----------------+----------+---------------+---------------------------+
+    +---------------+---------+--------------+---------------------------+
+    | Key           | Type    | Optionality  | Description               |
+    +===============+=========+==============+===========================+
+    | ``status``    | string  | Optional     | | Filters the status of   |
+    |               |         |              |   issues. Default:        |
+    |               |         |              |   ``Open``                |
+    +---------------+---------+--------------+---------------------------+
+    | ``tags``      | string  | Optional     | | A list of tags you      |
+    |               |         |              |   wish to filter. If      |
+    |               |         |              |   you want to filter      |
+    |               |         |              |   for issues not having   |
+    |               |         |              |   a tag, add an           |
+    |               |         |              |   exclamation mark in     |
+    |               |         |              |   front of it             |
+    +---------------+---------+--------------+---------------------------+
+    | ``assignee``  | string  | Optional     | | Filter the issues       |
+    |               |         |              |   by assignee             |
+    +---------------+---------+--------------+---------------------------+
+    | ``author``    | string  | Optional     | | Filter the issues       |
+    |               |         |              |   by creator              |
+    +---------------+---------+--------------+---------------------------+
 
     Sample response
     ^^^^^^^^^^^^^^^
@@ -397,7 +397,7 @@ def api_view_issue_comment(repo, issueid, commentid, username=None):
     ::
 
         {
-          "avatar_url": "https://seccdn.libravatar.org/avatar/...?s=16&d=retro",
+          "avatar_url": "https://seccdn.libravatar.org/avatar/...",
           "comment": "9",
           "comment_date": "2015-07-01 15:08",
           "date_created": "1435756127",
@@ -476,11 +476,11 @@ def api_change_status_issue(repo, issueid, username=None):
     Input
     ^^^^^
 
-    +--------------+----------+---------------+-------------------------------+
-    | Key          | Type     | Optionality   | Description                   |
-    +==============+==========+===============+===============================+
-    | ``status``   | string   | Mandatory     | The new status of the issue   |
-    +--------------+----------+---------------+-------------------------------+
+    +-------------+---------+--------------+------------------------------+
+    | Key         | Type    | Optionality  | Description                  |
+    +=============+=========+==============+==============================+
+    | ``status``  | string  | Mandatory    | The new status of the issue  |
+    +-------------+---------+--------------+------------------------------+
 
     Sample response
     ^^^^^^^^^^^^^^^
@@ -569,12 +569,12 @@ def api_comment_issue(repo, issueid, username=None):
     Input
     ^^^^^
 
-    +---------------+----------+---------------+---------------------------+
-    | Key           | Type     | Optionality   | Description               |
-    +===============+==========+===============+===========================+
-    | ``comment``   | string   | Mandatory     | | The comment to add to   |
-    |               |          |               |   the issue               |
-    +---------------+----------+---------------+---------------------------+
+    +--------------+----------+---------------+---------------------------+
+    | Key          | Type     | Optionality   | Description               |
+    +==============+==========+===============+===========================+
+    | ``comment``  | string   | Mandatory     | | The comment to add to   |
+    |              |          |               |   the issue               |
+    +--------------+----------+---------------+---------------------------+
 
     Sample response
     ^^^^^^^^^^^^^^^
diff --git a/pagure/forms.py b/pagure/forms.py
index 6bef2c8..cdd8e5d 100644
--- a/pagure/forms.py
+++ b/pagure/forms.py
@@ -327,4 +327,3 @@ class EditFileForm(wtf.Form):
             self.email.choices = [
                 (email.email, email.email) for email in kwargs['emails']
             ]
-
diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py
index 91615aa..4926dc1 100644
--- a/pagure/lib/__init__.py
+++ b/pagure/lib/__init__.py
@@ -1125,7 +1125,7 @@ def fork_project(session, user, repo, gitfolder,
 
     frepo = pygit2.clone_repository(reponame, forkreponame, bare=True)
     # Clone all the branches as well
-    for branch in  frepo.listall_branches(pygit2.GIT_BRANCH_REMOTE):
+    for branch in frepo.listall_branches(pygit2.GIT_BRANCH_REMOTE):
         if branch == 'origin/master':
             continue
         br = frepo.lookup_branch(branch, pygit2.GIT_BRANCH_REMOTE)
@@ -1625,6 +1625,7 @@ def close_pull_request(session, request, user, requestfolder, merged=True):
         )
     )
 
+
 def reset_status_pull_request(session, project):
     ''' Reset the status of all opened Pull-Requests of a project.
     '''
@@ -1786,7 +1787,7 @@ def update_user_ssh(session, user, ssh_key):
     message = 'Nothing to update'
 
     ssh_key = ssh_key.strip().replace('\n', '') \
-              if ssh_key and ssh_key.strip() else None
+        if ssh_key and ssh_key.strip() else None
 
     if ssh_key != user.public_ssh_key:
         user.public_ssh_key = ssh_key
diff --git a/pagure/lib/git.py b/pagure/lib/git.py
index a9f3a5b..a207e48 100644
--- a/pagure/lib/git.py
+++ b/pagure/lib/git.py
@@ -872,7 +872,7 @@ def merge_pull_request(
     if request.project.settings.get(
             'Enforce_signed-off_commits_in_pull-request', False):
         for commit in diff_commits:
-            if not 'signed-off-by' in commit.message.lower():
+            if 'signed-off-by' not in commit.message.lower():
                 raise pagure.exceptions.PagureException(
                     'This repo enforces that all commits are '
                     'signed off by their author. ')
diff --git a/pagure/ui/fork.py b/pagure/ui/fork.py
index 7775763..6407c09 100644
--- a/pagure/ui/fork.py
+++ b/pagure/ui/fork.py
@@ -705,7 +705,7 @@ def new_request_pull(repo, branch_to, branch_from, username=None):
             if repo.settings.get(
                     'Enforce_signed-off_commits_in_pull-request', False):
                 for commit in diff_commits:
-                    if not 'signed-off-by' in commit.message.lower():
+                    if 'signed-off-by' not in commit.message.lower():
                         raise pagure.exceptions.PagureException(
                             'This repo enforces that all commits are '
                             'signed off by their author. ')
diff --git a/pagure/ui/repo.py b/pagure/ui/repo.py
index d98b785..c447382 100644
--- a/pagure/ui/repo.py
+++ b/pagure/ui/repo.py
@@ -1321,7 +1321,8 @@ def edit_file(repo, branchname, filename, username=None):
 
 
 @APP.route('/<repo>/<path:branchname>/delete', methods=['POST'])
-@APP.route('/fork/<username>/<repo>/<path:branchname>/delete', methods=['POST'])
+@APP.route('/fork/<username>/<repo>/<path:branchname>/delete',
+           methods=['POST'])
 @cla_required
 def delete_branch(repo, branchname, username=None):
     """ Delete the branch of a project.

