Skip to content

Commit

Permalink
Merge pull request #1149 from brutasse/fix/new-flake8
Browse files Browse the repository at this point in the history
New flake8, new warnings to ignore
  • Loading branch information
brutasse committed Feb 11, 2015
2 parents 65b3956 + 58d5153 commit b340a70
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 17 deletions.
9 changes: 7 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,10 @@ obsoletes = graphite <= 0.9.9
# E227 missing whitespace around bitwise or shift operator
# E271 multiple spaces after keyword
# E272 multiple spaces before keyword

ignore=E128,E111,E501,E231,E201,E202,E203,E251,E124,E265,E121,E261,E226,E302,E262,E701,E241,E221,E703,E502,F841,E401,E222,E126,E303,E122,E222,E225,E301,E228,E127,E123,E713,E125,E227,E271,E272
# N802 function name should be lowercase
# N803 argument name should be lowercase
# N806 variable in function should be lowercase
# E731 do not assign a lambda expression, use a def
# E114 indentation is not a multiple of four (comment)
# E266 too many leading '#' for block comment
ignore=E128,E111,E501,E231,E201,E202,E203,E251,E124,E265,E121,E261,E226,E302,E262,E701,E241,E221,E703,E502,F841,E401,E222,E126,E303,E122,E222,E225,E301,E228,E127,E123,E713,E125,E227,E271,E272,N802,N803,N806,E731,E114,E266
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ commands =
sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html

[testenv:lint]
basepython = python2.7
deps =
flake8
commands =
Expand Down
5 changes: 3 additions & 2 deletions webapp/graphite/render/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ def evaluateTokens(requestContext, tokens):
return tokens.boolean[0] == 'true'


#Avoid import circularities
from graphite.render.functions import SeriesFunctions,NormalizeEmptyResultError
# Avoid import circularities
from graphite.render.functions import (SeriesFunctions,
NormalizeEmptyResultError) # noqa
15 changes: 7 additions & 8 deletions webapp/graphite/render/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,27 @@
#See the License for the specific language governing permissions and
#limitations under the License.


from datetime import datetime, timedelta
from itertools import izip, imap
import math
import re
import random
import re
import time

from datetime import datetime, timedelta
from itertools import izip, imap
from os import environ

from graphite.logger import log
from graphite.render.attime import parseTimeOffset, parseATTime

from graphite.events import models
from graphite.util import epoch

#XXX format_units() should go somewhere else
from os import environ
# XXX format_units() should go somewhere else
if environ.get('READTHEDOCS'):
format_units = lambda *args, **kwargs: (0,'')
else:
from graphite.render.glyph import format_units
from graphite.render.datalib import TimeSeries

from graphite.util import epoch

NAN = float('NaN')
INF = float('inf')
Expand Down
7 changes: 4 additions & 3 deletions webapp/graphite/wsgi.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'graphite.settings')

import django

from graphite.logger import log

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'graphite.settings')

if django.VERSION < (1, 4):
from django.core.handlers.wsgi import WSGIHandler
application = WSGIHandler()
Expand All @@ -17,7 +20,5 @@
# Initializing the search index can be very expensive. The import below
# ensures the index is preloaded before any requests are handed to the
# process.

from graphite.logger import log
log.info("graphite.wsgi - pid %d - reloading search index" % os.getpid())
import graphite.metrics.search # noqa
4 changes: 2 additions & 2 deletions webapp/tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import os
import shutil
import tempfile

from django import VERSION
from django.conf import settings, global_settings

# Silence the warning about an insecure SECRET_KEY
Expand All @@ -10,8 +12,6 @@
settings.configure(default_settings=global_settings)
from graphite.settings import * # noqa

from django import VERSION

if VERSION < (1, 6):
TEST_RUNNER = 'discover_runner.DiscoverRunner'

Expand Down

0 comments on commit b340a70

Please sign in to comment.