Permalink
Browse files

Make sure lint runs in Travis

  • Loading branch information...
1 parent 60416c5 commit 160991faca62d0c83c8706def65dd50c60d2e0c7 @yurishkuro yurishkuro committed May 21, 2016
Showing with 14 additions and 12 deletions.
  1. +1 −1 .travis.yml
  2. +1 −1 opentracing/__init__.py
  3. +3 −4 opentracing/ext/tags.py
  4. +1 −1 opentracing/propagation.py
  5. +2 −0 opentracing/span.py
  6. +6 −5 tests/test_utils.py
View
@@ -6,5 +6,5 @@ install:
- make bootstrap
script:
- - make test
+ - make test lint
@@ -20,7 +20,7 @@
from __future__ import absolute_import
from .span import Span # noqa
from .span import start_child_span # noqa
-from .span import canonicalize_baggage_key #noqa
+from .span import canonicalize_baggage_key # noqa
from .tracer import Tracer # noqa
from .propagation import Format # noqa
from .propagation import InvalidCarrierException # noqa
@@ -37,7 +37,7 @@
SPAN_KIND_RPC_SERVER = 'server'
# ---------------------------------------------------------------------------
-# COMPONENT (string) ia s low-cardinality identifier of the module, library,
+# COMPONENT (string) ia s low-cardinality identifier of the module, library,
# or package that is generating a span.
# ---------------------------------------------------------------------------
COMPONENT = 'component'
@@ -71,15 +71,14 @@
# HTTP tags
# ---------------------------------------------------------------------------
-# HTTP_URL string) should be the URL of the request being handled in this
+# HTTP_URL (string) should be the URL of the request being handled in this
# segment of the trace, in standard URI format. The protocol is optional.
HTTP_URL = 'http.url'
# HTTP_METHOD (string) is the HTTP method of the request.
# Both upper/lower case values are allowed.
HTTP_METHOD = 'http.method'
-# HTTP_STATUS_CODE (int) is the numeric HTTP status code (200, 404, etc)
+# HTTP_STATUS_CODE (int) is the numeric HTTP status code (200, 404, etc)
# of the HTTP response.
HTTP_STATUS_CODE = 'http.status_code'
-
@@ -70,7 +70,7 @@ class Format:
# NOTE: Since HTTP headers are a particularly important use case for the
# TEXT_MAP carrier, dict key parameters identify their respective values in
# a case-insensitive manner.
- #
+ #
# NOTE: The TEXT_MAP carrier dict may contain unrelated data (e.g.,
# arbitrary HTTP headers). As such, the Tracer implementation should use a
# prefix or other convention to distinguish Tracer-specific key:value
View
@@ -22,6 +22,7 @@
import re
+
class Span(object):
"""
Span represents a unit of work executed on behalf of a trace. Examples of
@@ -204,6 +205,7 @@ def start_child_span(parent_span, operation_name, tags=None, start_time=None):
_baggage_key_re = re.compile('^(?i)([a-z0-9][-a-z0-9]*)$')
+
def canonicalize_baggage_key(key):
"""canonicalize_baggage_key returns a canonicalized key if it's valid.
View
@@ -21,13 +21,14 @@
from __future__ import absolute_import
from opentracing import canonicalize_baggage_key
+
def test_canonicalize_baggage_key():
- badKey = "some-weird-sign!#"
- assert canonicalize_baggage_key(badKey) == None
+ badKey = 'some-weird-sign!#'
+ assert canonicalize_baggage_key(badKey) is None
- badKey2 = "-another-sign"
- assert canonicalize_baggage_key(badKey2) == None
+ badKey2 = '-another-sign'
+ assert canonicalize_baggage_key(badKey2) is None
- goodKey = "000-Capitalized-9"
+ goodKey = '000-Capitalized-9'
canonicalKey = canonicalize_baggage_key(goodKey)
assert canonicalKey == goodKey.lower()

0 comments on commit 160991f

Please sign in to comment.