Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue 918] Lint for print in /analytics #3026

Merged
merged 7 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
500 changes: 257 additions & 243 deletions analytics/poetry.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion analytics/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ ignore = [
"PTH123", # `open()` should be replaced by `Path.open()`
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"TD003", # missing an issue link on TODO
"T201", # use of `print` detected
"PT004", # pytest fixture leading underscore - is marked deprecated
"FA102", # Adding "from __future__ import annotations" to any new-style type annotation
]
Expand Down
1 change: 1 addition & 0 deletions analytics/src/analytics/cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ruff: noqa: T201
# pylint: disable=C0415
"""Expose a series of CLI entrypoints for the analytics package."""

Expand Down
6 changes: 5 additions & 1 deletion analytics/src/analytics/integrations/slack.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# ruff: noqa: T201
"""Integrate with Slack to post messages and get channel information."""

import functools
import logging
from collections.abc import Callable
from dataclasses import dataclass
from typing import Any
Expand All @@ -9,6 +11,8 @@
from slack_sdk.errors import SlackApiError
from slack_sdk.web.slack_response import SlackResponse

logger = logging.getLogger(__name__)


@dataclass
class FileMapping:
Expand All @@ -30,7 +34,7 @@ def try_to_make_slackbot_api_call_and_catch_error(
try:
return slackbot_api_call(*args, **kwargs)
except SlackApiError as e:
print(e)
logger.info(e)
return None

return try_to_make_slackbot_api_call_and_catch_error
Expand Down
1 change: 1 addition & 0 deletions analytics/tests/ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ ignore = [
"ANN201", # missing return type
"PLR2004", # magic value used in comparison instead of constant
"S101", # Use of `assert` detected
"T201", # use of `print` detected
]
Loading