Skip to content

Commit 3725392

Browse files
committed
Clean up code, update workflows, fix ruff issues
1 parent 1c829ab commit 3725392

File tree

12 files changed

+22
-50
lines changed

12 files changed

+22
-50
lines changed

.coveragerc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[report]
2+
exclude_lines =
3+
@abstract
4+
if TYPE_CHECKING:
5+
pragma: no cover

.github/workflows/codeql.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/pypi.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ jobs:
66
id-token: write
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v4
1010
- name: Set up Python
11-
uses: actions/setup-python@v2
11+
uses: actions/setup-python@v5
1212
with:
13-
python-version: '3.x'
13+
cache: pip
14+
python-version: 3.x
1415
- name: Install dependencies
1516
run: |
1617
python -m pip install --upgrade pip

.github/workflows/scorecards-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
jobs:
22
analysis:
3-
name: Scorecards analysis
3+
name: Scorecard analysis
44
permissions:
55
id-token: write
66
security-events: write
@@ -23,14 +23,14 @@ jobs:
2323
path: results.sarif
2424
retention-days: 5
2525
- name: Upload to code-scanning
26-
uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
26+
uses: github/codeql-action/upload-sarif@v3
2727
with:
2828
sarif_file: results.sarif
29-
name: Scorecards supply-chain security
29+
name: Scorecard supply-chain security
3030
on:
3131
branch_protection_rule:
3232
push:
3333
branches: [ master ]
3434
schedule:
35-
- cron: 30 1 * * 6
35+
- cron: 0 15 * * 1
3636
permissions: read-all

praw/models/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def authorize(self, code: str) -> str | None:
5858
return authorizer.refresh_token
5959

6060
@_deprecate_args("access_token", "expires_in", "scope")
61-
def implicit(self, *, access_token: str, expires_in: int, scope: str) -> None:
61+
def implicit(self, *, access_token: str, expires_in: int, scope: str):
6262
"""Set the active authorization to be an implicit authorization.
6363
6464
:param access_token: The access_token obtained from Reddit's callback.

praw/models/listing/listing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __len__(self) -> int:
2121
"""Return the number of items in the Listing."""
2222
return len(getattr(self, self.CHILD_ATTRIBUTE))
2323

24-
def __setattr__(self, attribute: str, value: Any) -> None:
24+
def __setattr__(self, attribute: str, value: Any):
2525
"""Objectify the ``CHILD_ATTRIBUTE`` attribute."""
2626
if attribute == self.CHILD_ATTRIBUTE:
2727
value = self._reddit._objector.objectify(value)

praw/models/reddit/collections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def __len__(self) -> int:
518518
"""
519519
return len(self.link_ids)
520520

521-
def __setattr__(self, attribute: str, value: Any) -> None:
521+
def __setattr__(self, attribute: str, value: Any):
522522
"""Objectify author, subreddit, and sorted_links attributes."""
523523
if attribute == "author_name":
524524
self.author = self._reddit.redditor(value)

praw/models/reddit/poll.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def user_selection(self) -> PollOption | None:
8686
return None
8787
return self.option(self._user_selection)
8888

89-
def __setattr__(self, attribute: str, value: Any) -> None:
89+
def __setattr__(self, attribute: str, value: Any):
9090
"""Objectify the options attribute, and save user_selection."""
9191
if attribute == "options" and isinstance(value, list):
9292
value = [PollOption(self._reddit, option) for option in value]

praw/reddit.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def read_only(self) -> bool:
9595
return self._core == self._read_only_core
9696

9797
@read_only.setter
98-
def read_only(self, value: bool) -> None:
98+
def read_only(self, value: bool):
9999
"""Set or unset the use of the ReadOnlyAuthorizer.
100100
101101
:raises: :class:`.ClientException` when attempting to unset ``read_only`` and
@@ -441,6 +441,7 @@ def request(self, *args, **kwargs):
441441
def _check_for_async(self):
442442
if self.config.check_for_async: # pragma: no cover
443443
try:
444+
# noinspection PyUnresolvedReferences
444445
shell = get_ipython().__class__.__name__
445446
if shell == "ZMQInteractiveShell":
446447
return

praw/util/token_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class FileTokenManager(BaseTokenManager):
8585
8686
"""
8787

88-
def __init__(self, filename: str) -> None:
88+
def __init__(self, filename: str):
8989
"""Initialize a :class:`.FileTokenManager` instance.
9090
9191
:param filename: The file the contains the refresh token.

0 commit comments

Comments
 (0)