Skip to content

Commit

Permalink
Upgrade build system to flit, add new pre-commit hooks, switch to ruf…
Browse files Browse the repository at this point in the history
…f for most linting checks, and lint and clean up code using ruff
  • Loading branch information
LilSpazJoekp committed Aug 31, 2023
1 parent 09b168a commit 3ed684d
Show file tree
Hide file tree
Showing 129 changed files with 1,629 additions and 1,749 deletions.
7 changes: 0 additions & 7 deletions .flake8

This file was deleted.

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ body:
- id: credential-check
attributes:
label: |
The `Reddit()` initialization in my code example does not include the following parameters to prevent credential leakage:
The `Reddit()` initialization in my code example does not include the following parameters to prevent credential leakage:
`client_secret`, `password`, or `refresh_token`.
options:
- label: "Yes"
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ This pull request provides ...

## References

-
-
65 changes: 34 additions & 31 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
default_language_version:
python: python3.11
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
hooks:
- id: end-of-file-fixer
exclude: .*\.txt
rev: v4.4.0

- repo: local
hooks:
- id: static_word_checks
Expand All @@ -24,6 +19,38 @@ repos:
pass_filenames: false
types: [ python ]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
args: [ --fix=no ]
- id: name-tests-test
args: [ --pytest-test-first ]
files: ^tests/integration/.*\.py|tests/unit/.*\.py$
- id: no-commit-to-branch
- id: sort-simple-yaml
files: ^(\.github/workflows/.*\.ya?ml|\.readthedocs.ya?ml)$
- id: trailing-whitespace

- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort-fix
files: ^(.*\.toml)$

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.286
hooks:
- id: ruff
args: [ --exit-non-zero-on-fix, --fix ]
files: ^(praw/.*.py)$

- repo: https://github.com/psf/black
hooks:
- id: black
Expand All @@ -34,27 +61,3 @@ repos:
- id: docstrfmt
require_serial: true
rev: v1.5.1

- repo: https://github.com/pycqa/flake8
hooks:
- id: flake8
rev: 6.1.0

- repo: https://github.com/ikamensh/flynt/
hooks:
- id: flynt
args:
- '-ll'
- '1000'
rev: '1.0.1'

- repo: https://github.com/pycqa/isort
hooks:
- id: isort
rev: 5.12.0

- repo: https://github.com/pycqa/pydocstyle
hooks:
- id: pydocstyle
files: praw/.*
rev: 6.3.0
245 changes: 0 additions & 245 deletions .pylintrc

This file was deleted.

2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Supported Versions

The supported versions of PRAW include the previous major release.
The supported versions of PRAW include the previous major release.
This means that if PRAW is on 6.5.0, PRAW versions 5.0.0 and greater are supported.

## Reporting a Vulnerability
Expand Down
2 changes: 1 addition & 1 deletion docs/code_overview/models/awards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,4 @@ Ternion All-Powerful .. image:: https://www.redditstatic.com/gold/awards/
heart, mind, and soul. Some might call it
unachievanium. Gives 5,000 Reddit Coins and six
months of r/lounge access and ad-free browsing.
========================== ====================================================================================================================================================================================== ========================================== ================================================== ======
========================== ====================================================================================================================================================================================== ========================================== ================================================== ======
1 change: 1 addition & 0 deletions docs/code_overview/other.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ them bound to an attribute of one of the PRAW models.
other/rule
other/stylesheet
other/sublisting
other/subredditlistingmixin
other/subredditmessage
other/token_manager
other/trophy
Expand Down
Empty file modified docs/code_overview/other/button.rst
100755 → 100644
Empty file.
Empty file modified docs/code_overview/other/buttonwidget.rst
100755 → 100644
Empty file.
Empty file modified docs/code_overview/other/calendar.rst
100755 → 100644
Empty file.
Empty file modified docs/code_overview/other/communitylist.rst
100755 → 100644
Empty file.
Empty file modified docs/code_overview/other/customwidget.rst
100755 → 100644
Empty file.
Empty file modified docs/code_overview/other/draftlist.rst
100755 → 100644
Empty file.
Empty file modified docs/code_overview/other/idcard.rst
100755 → 100644
Empty file.
Empty file modified docs/code_overview/other/image.rst
100755 → 100644
Empty file.
Empty file modified docs/code_overview/other/imagedata.rst
100755 → 100644
Empty file.
Empty file modified docs/code_overview/other/imagewidget.rst
100755 → 100644
Empty file.
Empty file modified docs/code_overview/other/menu.rst
100755 → 100644
Empty file.
Empty file modified docs/code_overview/other/menulink.rst
100755 → 100644
Empty file.
Empty file modified docs/code_overview/other/mod_action.rst
100755 → 100644
Empty file.
Empty file modified docs/code_overview/other/moderatorswidget.rst
100755 → 100644
Empty file.
Empty file modified docs/code_overview/other/postflairwidget.rst
100755 → 100644
Empty file.
Empty file modified docs/code_overview/other/prawbase.rst
100755 → 100644
Empty file.
Empty file modified docs/code_overview/other/ruleswidget.rst
100755 → 100644
Empty file.
Empty file modified docs/code_overview/other/submenu.rst
100755 → 100644
Empty file.
5 changes: 5 additions & 0 deletions docs/code_overview/other/subredditlistingmixin.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SubredditListingMixin
=====================

.. autoclass:: praw.models.listing.mixins.subreddit.SubredditListingMixin
:inherited-members:
Empty file modified docs/code_overview/other/subredditwidgets.rst
100755 → 100644
Empty file.
Empty file modified docs/code_overview/other/textarea.rst
100755 → 100644
Empty file.
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
nitpick_ignore = [
("py:class", "IO"),
("py:class", "prawcore.requestor.Requestor"),
("py:class", "prawcore.auth.BaseAuthorizer"),
("py:class", "praw.models.redditors.PartialRedditor"),
]
nitpicky = True
Expand Down

0 comments on commit 3ed684d

Please sign in to comment.