Skip to content

Commit

Permalink
fix(hybridcloud) Ignore fixtures/ from production code linting. (#54416)
Browse files Browse the repository at this point in the history
Add an ignore to metrics code as well. Unwinding this testutils import
doesn't seem straightforward and it would be better if the original team
took on this work.
  • Loading branch information
markstory authored Aug 9, 2023
1 parent d4c3f90 commit 9935a86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/sentry/sentry_metrics/client/snuba.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from sentry import quotas
from sentry.sentry_metrics.client.base import GenericMetricsBackend
from sentry.sentry_metrics.use_case_id_registry import UseCaseID
from sentry.testutils.cases import BaseMetricsTestCase
from sentry.testutils.cases import BaseMetricsTestCase # NOQA:S007


def build_mri(metric_name: str, type: str, use_case_id: UseCaseID, unit: Optional[str]) -> str:
Expand Down
2 changes: 2 additions & 0 deletions tools/flake8_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def visit_ImportFrom(self, node: ast.ImportFrom) -> None:
self.errors.append((node.lineno, node.col_offset, S006_msg))
elif (
"tests/" not in self.filename
and "fixtures/" not in self.filename
and "sentry/testutils/" not in self.filename
and "sentry.testutils" in node.module
):
Expand All @@ -62,6 +63,7 @@ def visit_Import(self, node: ast.Import) -> None:
self.errors.append((node.lineno, node.col_offset, S003_msg))
elif (
"tests/" not in self.filename
and "fixtures/" not in self.filename
and "sentry/testutils/" not in self.filename
and "sentry.testutils" in alias.name
):
Expand Down

0 comments on commit 9935a86

Please sign in to comment.