open-telemetry / open-telemetry/opentelemetry-python
Seems like pylint is not being executed on some files
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 19
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by applying the reproducer changes in opentelemetry-sdk/tests/metrics/test_periodic_exporting_metric_reader.py and opentelemetry-sdk/tests/trace/test_trace.py, then run tox -e lint. Compare how pylint processes the two disable directives and trace why one produces E0012. Done means the lint command handles both cases consistently without the reported bad-option-value failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100