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

Small APIdocs improvement #2828

Merged
merged 5 commits into from Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -51,6 +51,7 @@ lint: .venv
apidocs: .venv
@$(VENV_PATH)/bin/pip install --editable .
@$(VENV_PATH)/bin/pip install -U -r ./docs-requirements.txt
rm -rf docs/_build
szokeasaurusrex marked this conversation as resolved.
Show resolved Hide resolved
@$(VENV_PATH)/bin/sphinx-build -vv -W -b html docs/ docs/_build
.PHONY: apidocs

Expand Down
48 changes: 31 additions & 17 deletions sentry_sdk/scope.py
Expand Up @@ -441,13 +441,21 @@ def clear(self):

@_attr_setter
def level(self, value):
# type: (Optional[LogLevelStr]) -> None
"""When set this overrides the level. Deprecated in favor of set_level."""
# type: (LogLevelStr) -> None
"""
When set this overrides the level. Deprecated in favor of set_level.

:param value: The level to set.
"""
self._level = value
szokeasaurusrex marked this conversation as resolved.
Show resolved Hide resolved

def set_level(self, value):
# type: (Optional[LogLevelStr]) -> None
"""Sets the level for the scope."""
# type: (LogLevelStr) -> None
"""
Sets the level for the scope.

:param value: The level to set.
"""
self._level = value

@_attr_setter
Expand Down Expand Up @@ -555,20 +563,24 @@ def profile(self, profile):

self._profile = profile

def set_tag(
self,
key, # type: str
value, # type: Any
):
# type: (...) -> None
"""Sets a tag for a key to a specific value."""
def set_tag(self, key, value):
# type: (str, Any) -> None
"""
Sets a tag for a key to a specific value.

:param key: Key of the tag to set.

:param value: Value of the tag to set.
"""
self._tags[key] = value

def remove_tag(
self, key # type: str
):
# type: (...) -> None
"""Removes a specific tag."""
def remove_tag(self, key):
# type: (str) -> None
"""
Removes a specific tag.

:param key: Key of the tag to remove.
"""
self._tags.pop(key, None)

def set_context(
Expand All @@ -577,7 +589,9 @@ def set_context(
value, # type: Dict[str, Any]
):
# type: (...) -> None
"""Binds a context at a certain key to a specific value."""
"""
Binds a context at a certain key to a specific value.
"""
self._contexts[key] = value

def remove_context(
Expand Down