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

feat: replace pydocstyle with ruff #270

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ quality: ## check coding style with pycodestyle and pylint
pylint openedx_filters test_utils *.py
mypy
pycodestyle openedx_filters *.py
pydocstyle openedx_filters *.py
ruff check openedx_filters *.py
isort --check-only --diff --recursive test_utils openedx_filters *.py test_settings.py
python setup.py bdist_wheel
twine check dist/*
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pymongo==4.11.1
# via edx-opaque-keys
sqlparse==0.5.3
# via django
stevedore==5.4.0
stevedore==5.4.1
# via edx-opaque-keys
typing-extensions==4.12.2
# via edx-opaque-keys
Expand Down
2 changes: 1 addition & 1 deletion requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# make upgrade
#
cachetools==5.5.1
cachetools==5.5.2
# via tox
chardet==5.2.0
# via tox
Expand Down
20 changes: 8 additions & 12 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ build==1.2.2.post1
# via
# -r requirements/pip-tools.txt
# pip-tools
cachetools==5.5.1
cachetools==5.5.2
# via
# -r requirements/ci.txt
# tox
Expand Down Expand Up @@ -73,7 +73,7 @@ cryptography==44.0.1
# secretstorage
ddt==1.7.2
# via -r requirements/quality.txt
diff-cover==9.2.2
diff-cover==9.2.3
# via -r requirements/dev.in
dill==0.3.9
# via
Expand Down Expand Up @@ -128,7 +128,7 @@ iniconfig==2.0.0
# via
# -r requirements/quality.txt
# pytest
isort==6.0.0
isort==6.0.1
# via
# -r requirements/quality.txt
# pylint
Expand All @@ -144,7 +144,7 @@ jaraco-functools==4.1.0
# via
# -r requirements/quality.txt
# keyring
jeepney==0.8.0
jeepney==0.9.0
# via
# -r requirements/quality.txt
# keyring
Expand Down Expand Up @@ -185,7 +185,7 @@ mypy-extensions==1.0.0
# via
# -r requirements/quality.txt
# mypy
nh3==0.2.20
nh3==0.2.21
# via
# -r requirements/quality.txt
# readme-renderer
Expand Down Expand Up @@ -225,8 +225,6 @@ pycparser==2.22
# via
# -r requirements/quality.txt
# cffi
pydocstyle==6.3.0
# via -r requirements/quality.txt
pygments==2.19.1
# via
# -r requirements/quality.txt
Expand Down Expand Up @@ -305,6 +303,8 @@ rich==13.9.4
# via
# -r requirements/quality.txt
# twine
ruff==0.9.8
# via -r requirements/quality.txt
secretstorage==3.3.3
# via
# -r requirements/quality.txt
Expand All @@ -313,15 +313,11 @@ six==1.17.0
# via
# -r requirements/quality.txt
# edx-lint
snowballstemmer==2.2.0
# via
# -r requirements/quality.txt
# pydocstyle
sqlparse==0.5.3
# via
# -r requirements/quality.txt
# django
stevedore==5.4.0
stevedore==5.4.1
# via
# -r requirements/quality.txt
# code-annotations
Expand Down
17 changes: 10 additions & 7 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jaraco-context==6.0.1
# via keyring
jaraco-functools==4.1.0
# via keyring
jeepney==0.8.0
jeepney==0.9.0
# via
# keyring
# secretstorage
Expand Down Expand Up @@ -128,12 +128,13 @@ mypy-extensions==1.0.0
# via
# -r requirements/test.txt
# mypy
nh3==0.2.20
nh3==0.2.21
# via readme-renderer
packaging==24.2
# via
# -r requirements/test.txt
# build
# pydata-sphinx-theme
# pytest
# sphinx
# twine
Expand All @@ -147,7 +148,7 @@ pluggy==1.5.0
# pytest
pycparser==2.22
# via cffi
pydata-sphinx-theme==0.16.1
pydata-sphinx-theme==0.15.4
# via sphinx-book-theme
pygments==2.19.1
# via
Expand Down Expand Up @@ -197,6 +198,8 @@ rfc3986==2.0.0
# via twine
rich==13.9.4
# via twine
roman-numerals-py==3.1.0
# via sphinx
secretstorage==3.3.3
# via keyring
sniffio==1.3.1
Expand All @@ -205,7 +208,7 @@ snowballstemmer==2.2.0
# via sphinx
soupsieve==2.6
# via beautifulsoup4
sphinx==8.1.3
sphinx==8.2.1
# via
# -r requirements/doc.in
# pydata-sphinx-theme
Expand All @@ -216,7 +219,7 @@ sphinx==8.1.3
# sphinxcontrib-mermaid
sphinx-autobuild==2024.10.3
# via -r requirements/doc.in
sphinx-book-theme==1.1.3
sphinx-book-theme==1.1.4
# via -r requirements/doc.in
sphinx-copybutton==0.5.2
# via -r requirements/doc.in
Expand All @@ -240,9 +243,9 @@ sqlparse==0.5.3
# via
# -r requirements/test.txt
# django
starlette==0.45.3
starlette==0.46.0
# via sphinx-autobuild
stevedore==5.4.0
stevedore==5.4.1
# via
# -r requirements/test.txt
# code-annotations
Expand Down
2 changes: 1 addition & 1 deletion requirements/pip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ pip==24.2
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/pip.in
setuptools==75.8.0
setuptools==75.8.2
# via -r requirements/pip.in
2 changes: 1 addition & 1 deletion requirements/quality.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
edx-lint # edX pylint rules and plugins
isort # to standardize order of imports
pycodestyle # PEP 8 compliance validation
pydocstyle # PEP 257 compliance validation
twine # Utility for publishing Python packages on PyPI.
mypy # Static type checker
ruff # A modern Python code linter and formatter.
14 changes: 6 additions & 8 deletions requirements/quality.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ iniconfig==2.0.0
# via
# -r requirements/test.txt
# pytest
isort==6.0.0
isort==6.0.1
# via
# -r requirements/quality.in
# pylint
Expand All @@ -85,7 +85,7 @@ jaraco-context==6.0.1
# via keyring
jaraco-functools==4.1.0
# via keyring
jeepney==0.8.0
jeepney==0.9.0
# via
# keyring
# secretstorage
Expand Down Expand Up @@ -117,7 +117,7 @@ mypy-extensions==1.0.0
# via
# -r requirements/test.txt
# mypy
nh3==0.2.20
nh3==0.2.21
# via readme-renderer
packaging==24.2
# via
Expand All @@ -138,8 +138,6 @@ pycodestyle==2.12.1
# via -r requirements/quality.in
pycparser==2.22
# via cffi
pydocstyle==6.3.0
# via -r requirements/quality.in
pygments==2.19.1
# via
# readme-renderer
Expand Down Expand Up @@ -192,17 +190,17 @@ rfc3986==2.0.0
# via twine
rich==13.9.4
# via twine
ruff==0.9.8
# via -r requirements/quality.in
secretstorage==3.3.3
# via keyring
six==1.17.0
# via edx-lint
snowballstemmer==2.2.0
# via pydocstyle
sqlparse==0.5.3
# via
# -r requirements/test.txt
# django
stevedore==5.4.0
stevedore==5.4.1
# via
# -r requirements/test.txt
# code-annotations
Expand Down
2 changes: 1 addition & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ sqlparse==0.5.3
# via
# -r requirements/base.txt
# django
stevedore==5.4.0
stevedore==5.4.1
# via
# -r requirements/base.txt
# code-annotations
Expand Down
24 changes: 24 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[lint]
select = [
"D", # pydocstyle
]

ignore = [
"D101", # Missing docstring in public class
"D200", # One-line docstring should fit on one line
"D212", # Multi-line docstring summary should start at the first line
"D405", # Section name should be properly capitalized
"D410", # Missing blank line after section
"D411", # Missing blank line before section
"D412", # No blank lines allowed between a section header and its content
"D414", # Section has no content,

# Ignore all other pydocstyle errors
"D102", # Missing docstring in public method
"D205", # 1 blank line required between summary line and description
"D415", # First line should end with a period, question mark, or exclamation point
]

[lint.pydocstyle]
# Use Google-style docstrings.
convention = "google"
21 changes: 0 additions & 21 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[tox]
envlist = py{311, 312}-django{42}, quality, docs


[doc8]
; D001 = Line too long
ignore=D001
Expand All @@ -11,26 +10,6 @@ exclude = .git,.tox
max-line-length = 120
max-doc-length = 120

[pydocstyle]
; D101 = Missing docstring in public class
; D200 = One-line docstring should fit on one line with quotes
; D203 = 1 blank line required before class docstring
; D212 = Multi-line docstring summary should start at the first line
; D215 = Section underline is over-indented (numpy style)
; D404 = First word of the docstring should not be This (numpy style)
; D405 = Section name should be properly capitalized (numpy style)
; D406 = Section name should end with a newline (numpy style)
; D407 = Missing dashed underline after section (numpy style)
; D408 = Section underline should be in the line following the section's name (numpy style)
; D409 = Section underline should match the length of its name (numpy style)
; D410 = Missing blank line after section (numpy style)
; D411 = Missing blank line before section (numpy style)
; D412 = No blank lines allowed between a section header and its content (numpy style)
; D413 = Missing blank line after last section (numpy style)
; D414 = Section has no content (numpy style)
ignore = D101,D200,D203,D212,D215,D404,D405,D406,D407,D408,D409,D410,D411,D412,D413,D414


[pytest]
DJANGO_SETTINGS_MODULE = test_utils.test_settings
addopts = --cov openedx_filters --cov-report term-missing --cov-report xml
Expand Down