opentelemetry-python icon indicating copy to clipboard operation
opentelemetry-python copied to clipboard

Seems like pylint is not being executed on some files

Open ocelotl opened this issue 3 years ago • 1 comments

I accidentally found this issue while working on #2886. To reproduce, add these changes in main:

diff --git a/opentelemetry-sdk/tests/metrics/test_periodic_exporting_metric_reader.py b/opentelemetry-sdk/tests/metrics/test_periodic_exporting_metric_reader.py
index bdc15eb96..cb0e5a400 100644
--- a/opentelemetry-sdk/tests/metrics/test_periodic_exporting_metric_reader.py
+++ b/opentelemetry-sdk/tests/metrics/test_periodic_exporting_metric_reader.py
@@ -38,6 +38,7 @@ from opentelemetry.test.concurrency_test import ConcurrencyTestBase
 from opentelemetry.util._time import _time_ns
 
 
+# pylint: disable=bad-argument
 class FakeMetricsExporter(MetricExporter):
     def __init__(
         self, wait=0, preferred_temporality=None, preferred_aggregation=None
diff --git a/opentelemetry-sdk/tests/trace/test_trace.py b/opentelemetry-sdk/tests/trace/test_trace.py
index 13ccc20f1..57e0bff8c 100644
--- a/opentelemetry-sdk/tests/trace/test_trace.py
+++ b/opentelemetry-sdk/tests/trace/test_trace.py
@@ -138,6 +138,7 @@ tracer_provider.add_span_processor(mock_processor)
         )
 
 
+# pylint: disable=bad-argument
 class TestTracerSampling(unittest.TestCase):
     def tearDown(self):
         reload(trace)

Run tox -e lint, it fails like this:

************* Module tests.trace.test_trace                                                    
opentelemetry-sdk/tests/trace/test_trace.py:141:0: E0012: Bad option value 'bad-argument' (bad-option-value)
                                               
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, -0.00)

So, one of the bad pylint: disable lines is being ignored.

ocelotl avatar Aug 23 '22 14:08 ocelotl

@ocelotl is that a valid pylint usage? Can you disable pylint for class like that?

srikanthccv avatar Sep 01 '22 16:09 srikanthccv