Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.

Commit ada2ea6

Browse files
authored
Merge pull request #48 from honeycombio/tredman.pylint
[setuptools] enforce lint errors in CI checks
2 parents c5c0f6d + 173fbe4 commit ada2ea6

File tree

4 files changed

+792
-10
lines changed

4 files changed

+792
-10
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ python:
33
- '2.7'
44
- '3.5'
55
- '3.6'
6-
install: pip install pyflakes==1.5.0
7-
script: pyflakes beeline && python setup.py test
6+
install: pip install pyflakes==1.5.0 pylint setuptools-lint
7+
script: pyflakes beeline && python setup.py lint --lint-rcfile pylint.rc && python setup.py test
88
deploy:
99
provider: pypi
1010
user: honeycomb

beeline/middleware/django/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def __call__(self, execute, sql, params, many, context):
4040
else:
4141
return result
4242
finally:
43-
if vendor == "postgresql" or vendor == "mysql":
43+
if vendor in ('postgresql', 'mysql'):
4444
beeline.add_context({
4545
"db.last_insert_id": context['cursor'].cursor.lastrowid,
4646
"db.rows_affected": context['cursor'].cursor.rowcount,

beeline/test_trace.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ def test_run_hooks_and_send_no_hooks(self):
274274
# always call send_presampled
275275
# send should never be called because at a minimum we always do deterministic
276276
# sampling
277-
m_span.event.send.assert_not_called()
278-
m_span.event.send_presampled.assert_called_once_with()
277+
m_span.event.send.assert_not_called() # pylint: disable=no-member
278+
m_span.event.send_presampled.assert_called_once_with() # pylint: disable=no-member
279279

280280
def test_run_hooks_and_send_sampler(self):
281281
''' ensure send works with a sampler hook defined '''
@@ -293,8 +293,8 @@ def _sampler_drop_all(fields):
293293
tracer._run_hooks_and_send(m_span)
294294

295295
# sampler ensures we drop everything
296-
m_span.event.send.assert_not_called()
297-
m_span.event.send_presampled.assert_not_called()
296+
m_span.event.send.assert_not_called() # pylint: disable=no-member
297+
m_span.event.send_presampled.assert_not_called() # pylint: disable=no-member
298298

299299
def _sampler_drop_none(fields):
300300
return True, 100
@@ -308,8 +308,8 @@ def _sampler_drop_none(fields):
308308

309309
# sampler drops nothing, _should_sample rigged to always return true so
310310
# we always call send_presampled
311-
m_span.event.send.assert_not_called()
312-
m_span.event.send_presampled.assert_called_once_with()
311+
m_span.event.send.assert_not_called() # pylint: disable=no-member
312+
m_span.event.send_presampled.assert_called_once_with() # pylint: disable=no-member
313313
# ensure event is updated with new sample rate
314314
self.assertEqual(m_span.event.sample_rate, 100)
315315

@@ -335,7 +335,7 @@ def _presend_hook(fields):
335335
m_sample_fn.return_value = True
336336
tracer._run_hooks_and_send(m_span)
337337

338-
m_span.event.send_presampled.assert_called_once_with()
338+
m_span.event.send_presampled.assert_called_once_with() # pylint: disable=no-member
339339
self.assertDictEqual(
340340
m_span.event.fields(),
341341
{

0 commit comments

Comments
 (0)