diff --git a/ev-server/pagure_stream_server.py b/ev-server/pagure_stream_server.py index 0d74f1d..d2ed404 100644 --- a/ev-server/pagure_stream_server.py +++ b/ev-server/pagure_stream_server.py @@ -35,9 +35,9 @@ if 'PAGURE_CONFIG' not in os.environ \ os.environ['PAGURE_CONFIG'] = '/etc/pagure/pagure.cfg' -import pagure # noqa -import pagure.lib # noqa -from pagure.exceptions import PagureEvException # noqa +import pagure # noqa: E402 +import pagure.lib # noqa: E402 +from pagure.exceptions import PagureEvException # noqa: E402 SERVER = None diff --git a/pagure/__init__.py b/pagure/__init__.py index ee0e4e0..6a9b417 100644 --- a/pagure/__init__.py +++ b/pagure/__init__.py @@ -10,40 +10,40 @@ # These two lines are needed to run on EL6 __requires__ = ['SQLAlchemy >= 0.8', 'jinja2 >= 2.4'] -import pkg_resources # noqa +import pkg_resources # noqa: E402 __version__ = '2.14.2' __api_version__ = '0.12' -import datetime # noqa -import logging # noqa -import os # noqa -import re # noqa -import subprocess # noqa -import urlparse # noqa -from logging.handlers import SMTPHandler # noqa +import datetime # noqa: E402 +import logging # noqa: E402 +import os # noqa: E402 +import re # noqa: E402 +import subprocess # noqa: E402 +import urlparse # noqa: E402 +from logging.handlers import SMTPHandler # noqa: E402 -import flask # noqa -import pygit2 # noqa -import werkzeug # noqa -from functools import wraps # noqa -from sqlalchemy.exc import SQLAlchemyError # noqa +import flask # noqa: E402 +import pygit2 # noqa: E402 +import werkzeug # noqa: E402 +from functools import wraps # noqa: E402 +from sqlalchemy.exc import SQLAlchemyError # noqa: E402 -from pygments import highlight # noqa -from pygments.lexers.text import DiffLexer # noqa -from pygments.formatters import HtmlFormatter # noqa +from pygments import highlight # noqa: E402 +from pygments.lexers.text import DiffLexer # noqa: E402 +from pygments.formatters import HtmlFormatter # noqa: E402 -from flask_multistatic import MultiStaticFlask # noqa +from flask_multistatic import MultiStaticFlask # noqa: E402 -from werkzeug.routing import BaseConverter # noqa +from werkzeug.routing import BaseConverter # noqa: E402 if os.environ.get('PAGURE_PERFREPO'): - import pagure.perfrepo as perfrepo # noqa + import pagure.perfrepo as perfrepo # noqa: E402 else: perfrepo = None -import pagure.exceptions # noqa +import pagure.exceptions # noqa: E402 # Create the application. APP = MultiStaticFlask(__name__) @@ -93,13 +93,13 @@ if APP.config.get('THEME_STATIC_FOLDER', False): ] -import pagure.doc_utils # noqa -import pagure.forms # noqa -import pagure.lib # noqa -import pagure.lib.git # noqa -import pagure.login_forms # noqa -import pagure.mail_logging # noqa -import pagure.proxy # noqa +import pagure.doc_utils # noqa: E402 +import pagure.forms # noqa: E402 +import pagure.lib # noqa: E402 +import pagure.lib.git # noqa: E402 +import pagure.login_forms # noqa: E402 +import pagure.mail_logging # noqa: E402 +import pagure.proxy # noqa: E402 # Only import flask_fas_openid if it is needed if APP.config.get('PAGURE_AUTH', None) in ['fas', 'openid']: @@ -795,18 +795,18 @@ urlregex = re.compile( urlpattern = re.compile(urlregex) # Import the application -import pagure.ui.app # noqa -import pagure.ui.fork # noqa -import pagure.ui.groups # noqa +import pagure.ui.app # noqa: E402 +import pagure.ui.fork # noqa: E402 +import pagure.ui.groups # noqa: E402 if APP.config.get('ENABLE_TICKETS', True): - import pagure.ui.issues # noqa -import pagure.ui.plugins # noqa -import pagure.ui.repo # noqa + import pagure.ui.issues # noqa: E402 +import pagure.ui.plugins # noqa: E402 +import pagure.ui.repo # noqa: E402 -from pagure.api import API # noqa +from pagure.api import API # noqa: E402 APP.register_blueprint(API) -import pagure.internal # noqa +import pagure.internal # noqa: E402 APP.register_blueprint(pagure.internal.PV) diff --git a/pagure/api/__init__.py b/pagure/api/__init__.py index 6482699..c3c22aa 100644 --- a/pagure/api/__init__.py +++ b/pagure/api/__init__.py @@ -26,11 +26,11 @@ import markupsafe API = flask.Blueprint('api_ns', __name__, url_prefix='/api/0') -import pagure # noqa -import pagure.lib # noqa -from pagure import __api_version__, APP, SESSION, authenticated # noqa -from pagure.doc_utils import load_doc, modify_rst, modify_html # noqa -from pagure.exceptions import APIError # noqa +import pagure # noqa: E402 +import pagure.lib # noqa: E402 +from pagure import __api_version__, APP, SESSION, authenticated # noqa: E402 +from pagure.doc_utils import load_doc, modify_rst, modify_html # noqa: E402 +from pagure.exceptions import APIError # noqa: E402 def preload_docs(endpoint): @@ -209,14 +209,14 @@ def api_method(function): if pagure.APP.config.get('ENABLE_TICKETS', True): - from pagure.api import issue # noqa -from pagure.api import fork # noqa -from pagure.api import project # noqa -from pagure.api import user # noqa -from pagure.api import group # noqa + from pagure.api import issue # noqa: E402 +from pagure.api import fork # noqa: E402 +from pagure.api import project # noqa: E402 +from pagure.api import user # noqa: E402 +from pagure.api import group # noqa: E402 if pagure.APP.config.get('PAGURE_CI_SERVICES', False): - from pagure.api.ci import jenkins # noqa + from pagure.api.ci import jenkins # noqa: E402 @API.route('/version/') diff --git a/pagure/cli/admin.py b/pagure/cli/admin.py index ee95bcc..cc840ca 100644 --- a/pagure/cli/admin.py +++ b/pagure/cli/admin.py @@ -20,10 +20,10 @@ if 'PAGURE_CONFIG' not in os.environ \ print('Using configuration file `/etc/pagure/pagure.cfg`') os.environ['PAGURE_CONFIG'] = '/etc/pagure/pagure.cfg' -import pagure.exceptions # noqa -import pagure.lib # noqa -import pagure.lib.git # noqa -from pagure import (SESSION, APP, generate_user_key_files) # noqa +import pagure.exceptions # noqa: E402 +import pagure.lib # noqa: E402 +import pagure.lib.git # noqa: E402 +from pagure import (SESSION, APP, generate_user_key_files) # noqa: E402 _log = logging.getLogger(__name__) diff --git a/pagure/hooks/files/default_hook.py b/pagure/hooks/files/default_hook.py index 36cb3f4..790d8d6 100755 --- a/pagure/hooks/files/default_hook.py +++ b/pagure/hooks/files/default_hook.py @@ -18,11 +18,11 @@ if 'PAGURE_CONFIG' not in os.environ \ os.environ['PAGURE_CONFIG'] = '/etc/pagure/pagure.cfg' -import pagure # noqa -import pagure.exceptions # noqa -import pagure.lib.link # noqa +import pagure # noqa: E402 +import pagure.exceptions # noqa: E402 +import pagure.lib.link # noqa: E402 -from pagure.lib import REDIS # noqa +from pagure.lib import REDIS # noqa: E402 abspath = os.path.abspath(os.environ['GIT_DIR']) diff --git a/pagure/hooks/files/fedmsg_hook.py b/pagure/hooks/files/fedmsg_hook.py index b8a6052..c20220f 100755 --- a/pagure/hooks/files/fedmsg_hook.py +++ b/pagure/hooks/files/fedmsg_hook.py @@ -12,8 +12,8 @@ if 'PAGURE_CONFIG' not in os.environ \ os.environ['PAGURE_CONFIG'] = '/etc/pagure/pagure.cfg' -import pagure # noqa -import pagure.lib.git # noqa +import pagure # noqa: E402 +import pagure.lib.git # noqa: E402 abspath = os.path.abspath(os.environ['GIT_DIR']) diff --git a/pagure/hooks/files/pagure_block_unsigned.py b/pagure/hooks/files/pagure_block_unsigned.py index deb9d5a..865c309 100755 --- a/pagure/hooks/files/pagure_block_unsigned.py +++ b/pagure/hooks/files/pagure_block_unsigned.py @@ -14,10 +14,10 @@ if 'PAGURE_CONFIG' not in os.environ \ os.environ['PAGURE_CONFIG'] = '/etc/pagure/pagure.cfg' -import pagure # noqa -import pagure.exceptions # noqa -import pagure.lib.link # noqa -import pagure.ui.plugins # noqa +import pagure # noqa: E402 +import pagure.exceptions # noqa: E402 +import pagure.lib.link # noqa: E402 +import pagure.ui.plugins # noqa: E402 abspath = os.path.abspath(os.environ['GIT_DIR']) diff --git a/pagure/hooks/files/pagure_force_commit_hook.py b/pagure/hooks/files/pagure_force_commit_hook.py index ac6f9f6..d06971d 100755 --- a/pagure/hooks/files/pagure_force_commit_hook.py +++ b/pagure/hooks/files/pagure_force_commit_hook.py @@ -13,10 +13,10 @@ if 'PAGURE_CONFIG' not in os.environ \ os.environ['PAGURE_CONFIG'] = '/etc/pagure/pagure.cfg' -import pagure # noqa -import pagure.exceptions # noqa -import pagure.lib.link # noqa -import pagure.lib.plugins # noqa +import pagure # noqa: E402 +import pagure.exceptions # noqa: E402 +import pagure.lib.link # noqa: E402 +import pagure.lib.plugins # noqa: E402 abspath = os.path.abspath(os.environ['GIT_DIR']) diff --git a/pagure/hooks/files/pagure_hook.py b/pagure/hooks/files/pagure_hook.py index 115db53..d88bdd5 100755 --- a/pagure/hooks/files/pagure_hook.py +++ b/pagure/hooks/files/pagure_hook.py @@ -17,9 +17,9 @@ if 'PAGURE_CONFIG' not in os.environ \ os.environ['PAGURE_CONFIG'] = '/etc/pagure/pagure.cfg' -import pagure # noqa -import pagure.exceptions # noqa -import pagure.lib.link # noqa +import pagure # noqa: E402 +import pagure.exceptions # noqa: E402 +import pagure.lib.link # noqa: E402 abspath = os.path.abspath(os.environ['GIT_DIR']) diff --git a/pagure/hooks/files/pagure_hook_requests.py b/pagure/hooks/files/pagure_hook_requests.py index f9b1237..31cc5a1 100755 --- a/pagure/hooks/files/pagure_hook_requests.py +++ b/pagure/hooks/files/pagure_hook_requests.py @@ -16,7 +16,7 @@ if 'PAGURE_CONFIG' not in os.environ \ os.environ['PAGURE_CONFIG'] = '/etc/pagure/pagure.cfg' -import pagure.lib.git # noqa +import pagure.lib.git # noqa: E402 abspath = os.path.abspath(os.environ['GIT_DIR']) diff --git a/pagure/hooks/files/pagure_hook_tickets.py b/pagure/hooks/files/pagure_hook_tickets.py index 2233851..4c5fac5 100755 --- a/pagure/hooks/files/pagure_hook_tickets.py +++ b/pagure/hooks/files/pagure_hook_tickets.py @@ -16,10 +16,10 @@ if 'PAGURE_CONFIG' not in os.environ \ and os.path.exists('/etc/pagure/pagure.cfg'): os.environ['PAGURE_CONFIG'] = '/etc/pagure/pagure.cfg' -import pagure # noqa -import pagure.lib.git # noqa +import pagure # noqa: E402 +import pagure.lib.git # noqa: E402 -from pagure.lib import REDIS # noqa +from pagure.lib import REDIS # noqa: E402 abspath = os.path.abspath(os.environ['GIT_DIR']) diff --git a/pagure/hooks/files/rtd_hook.py b/pagure/hooks/files/rtd_hook.py index fa6dcb1..56c3dca 100755 --- a/pagure/hooks/files/rtd_hook.py +++ b/pagure/hooks/files/rtd_hook.py @@ -15,10 +15,10 @@ if 'PAGURE_CONFIG' not in os.environ \ os.environ['PAGURE_CONFIG'] = '/etc/pagure/pagure.cfg' -import pagure # noqa -import pagure.exceptions # noqa -import pagure.lib.link # noqa -import pagure.lib.plugins # noqa +import pagure # noqa: E402 +import pagure.exceptions # noqa: E402 +import pagure.lib.link # noqa: E402 +import pagure.lib.plugins # noqa: E402 abspath = os.path.abspath(os.environ['GIT_DIR']) diff --git a/pagure/internal/__init__.py b/pagure/internal/__init__.py index 11b0df2..2cbaad2 100644 --- a/pagure/internal/__init__.py +++ b/pagure/internal/__init__.py @@ -20,13 +20,13 @@ from sqlalchemy.exc import SQLAlchemyError PV = flask.Blueprint('internal_ns', __name__, url_prefix='/pv') -import pagure # noqa -import pagure.exceptions # noqa -import pagure.forms # noqa -import pagure.lib # noqa -import pagure.lib.git # noqa -import pagure.ui.fork # noqa -from pagure import is_repo_admin, authenticated # noqa +import pagure # noqa: E402 +import pagure.exceptions # noqa: E402 +import pagure.forms # noqa: E402 +import pagure.lib # noqa: E402 +import pagure.lib.git # noqa: E402 +import pagure.ui.fork # noqa: E402 +from pagure import is_repo_admin, authenticated # noqa: E402 MERGE_OPTIONS = { diff --git a/pagure/lib/lib_ci.py b/pagure/lib/lib_ci.py index 5f53107..e33b809 100644 --- a/pagure/lib/lib_ci.py +++ b/pagure/lib/lib_ci.py @@ -17,7 +17,7 @@ import pagure.lib # This import is needed as pagure.lib relies on Project.ci_hook to be # defined and accessible and this happens in pagure.hooks.pagure_ci -from pagure.hooks import pagure_ci # noqa +from pagure.hooks import pagure_ci # noqa: E402 BUILD_STATS = { diff --git a/pagure/lib/model.py b/pagure/lib/model.py index 7530d70..b551c53 100644 --- a/pagure/lib/model.py +++ b/pagure/lib/model.py @@ -9,7 +9,7 @@ """ __requires__ = ['SQLAlchemy >= 0.8', 'jinja2 >= 2.4'] # noqa -import pkg_resources # noqa +import pkg_resources # noqa: E402 import datetime import collections