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: [FC-0074] use linter for event code-annotations #448

Merged
merged 9 commits into from
Jan 30, 2025
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ Change Log
Unreleased
__________

[9.17.0] - 2025-01-30
---------------------

Added
~~~~~

* Use edx-lint linter for Open edX Events instances in-line code annotations validation.

[9.16.0] - 2025-01-30
---------------------

Expand Down
2 changes: 1 addition & 1 deletion openedx_events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
more information about the project.
"""

__version__ = "9.16.0"
__version__ = "9.17.0"
4 changes: 2 additions & 2 deletions openedx_events/content_authoring/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@

# .. event_type: org.openedx.content_authoring.content.object.associations.changed.v1
# .. event_name: CONTENT_OBJECT_ASSOCIATIONS_CHANGED
# .. event_description: Emitted when an object's associations are changed, e.g tags, collections.
# .. event_data: ContentObjectData
# .. event_description: Emitted when an object's associations are changed, e.g tags, collections
# .. event_data: ContentObjectChangedData
# .. event_trigger_repository: openedx/edx-platform
CONTENT_OBJECT_ASSOCIATIONS_CHANGED = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.content.object.associations.changed.v1",
Expand Down
2 changes: 1 addition & 1 deletion openedx_events/event_bus/avro/tests/test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def create_simple_signal(data_dict, event_type="simple.signal"):
data_dict: Description of attributes passed to the signal
event_type: A custom event type string. Defaults to 'simple.signal'
"""
return OpenEdxPublicSignal(
return OpenEdxPublicSignal( # pylint: disable=missing-or-incorrect-annotation
event_type=event_type,
data=data_dict
)
Expand Down
4 changes: 2 additions & 2 deletions openedx_events/learning/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
}
)

# .. event_type: org.openedx.learning.course.persistent_grade.summary.v1
# .. event_type: org.openedx.learning.course.persistent_grade_summary.changed.v1
# .. event_name: PERSISTENT_GRADE_SUMMARY_CHANGED
# .. event_description: Emitted when a course's persistent grade summary changes for a user.
# .. event_data: PersistentCourseGradeData
Expand Down Expand Up @@ -221,7 +221,7 @@
# .. event_type: org.openedx.learning.user.notification.requested.v1
# .. event_name: USER_NOTIFICATION_REQUESTED
# .. event_description: Can be emitted from apps to send user notifications.
# .. event_data: UserNotificationSendListData
# .. event_data: UserNotificationData
# .. event_warning: This event is currently incompatible with the event bus, list without annotations
# are not serializable.
# .. event_trigger_repository: openedx/edx-platform openedx/edx-ora2
Expand Down
2 changes: 1 addition & 1 deletion openedx_events/tests/test_tooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def setUp(self):
self.data_attr = {
"user": Mock,
}
self.public_signal = OpenEdxPublicSignal(
self.public_signal = OpenEdxPublicSignal( # pylint: disable=missing-or-incorrect-annotation
event_type=self.event_type,
data=self.data_attr,
)
Expand Down
7 changes: 4 additions & 3 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@
# SERIOUSLY.
#
# ------------------------------
# Generated by edx-lint version: 5.2.5
# Generated by edx-lint version: 5.6.0
# ------------------------------
[MASTER]
ignore = migrations
persistent = yes
load-plugins = edx_lint.pylint,pylint_celery
load-plugins = edx_lint.pylint,pylint_celery,edx_lint.pylint.events_annotation

[MESSAGES CONTROL]
enable =
Expand Down Expand Up @@ -259,6 +259,7 @@ enable =
useless-suppression,
disable =
bad-indentation,
broad-exception-raised,
consider-using-f-string,
duplicate-code,
file-ignored,
Expand Down Expand Up @@ -382,4 +383,4 @@ int-import-graph =
[EXCEPTIONS]
overgeneral-exceptions = builtins.Exception

# afac0308552b9baa632c39eb574d26e9725303f1
# 296c1df70c75516c9174713c7916b982e2768f71
2 changes: 1 addition & 1 deletion pylintrc_tweaks
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pylintrc tweaks for use with edx_lint.
[MASTER]
ignore = migrations
load-plugins = edx_lint.pylint,pylint_celery
load-plugins = edx_lint.pylint,pylint_celery,edx_lint.pylint.events_annotation
6 changes: 3 additions & 3 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
asgiref==3.8.1
# via django
attrs==24.3.0
attrs==25.1.0
# via -r requirements/base.in
cffi==1.17.1
# via pynacl
Expand Down Expand Up @@ -35,15 +35,15 @@ edx-opaque-keys[django]==2.11.0
# edx-ccx-keys
fastavro==1.10.0
# via -r requirements/base.in
newrelic==10.4.0
newrelic==10.5.0
# via edx-django-utils
pbr==6.1.0
# via stevedore
psutil==6.1.1
# via edx-django-utils
pycparser==2.22
# via cffi
pymongo==4.10.1
pymongo==4.11
# via edx-opaque-keys
pynacl==1.5.0
# via edx-django-utils
Expand Down
8 changes: 4 additions & 4 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
#
# make upgrade
#
cachetools==5.5.0
cachetools==5.5.1
# via tox
chardet==5.2.0
# via tox
colorama==0.4.6
# via tox
distlib==0.3.9
# via virtualenv
filelock==3.16.1
filelock==3.17.0
# via
# tox
# virtualenv
Expand All @@ -26,9 +26,9 @@ platformdirs==4.3.6
# virtualenv
pluggy==1.5.0
# via tox
pyproject-api==1.8.0
pyproject-api==1.9.0
# via tox
tox==4.23.2
tox==4.24.1
# via -r requirements/ci.in
virtualenv==20.29.1
# via tox
29 changes: 15 additions & 14 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ astroid==2.15.8
# -r requirements/quality.txt
# pylint
# pylint-celery
attrs==24.3.0
attrs==25.1.0
# via -r requirements/quality.txt
backports-tarfile==1.2.0
# via
Expand All @@ -24,7 +24,7 @@ build==1.2.2.post1
# via
# -r requirements/pip-tools.txt
# pip-tools
cachetools==5.5.0
cachetools==5.5.1
# via
# -r requirements/ci.txt
# tox
Expand Down Expand Up @@ -114,24 +114,28 @@ edx-ccx-keys==2.0.2
# via -r requirements/quality.txt
edx-django-utils==7.1.0
# via -r requirements/quality.txt
edx-lint==5.4.1
edx-lint==5.6.0
# via -r requirements/quality.txt
edx-opaque-keys[django]==2.11.0
# via
# -r requirements/quality.txt
# edx-ccx-keys
fastavro==1.10.0
# via -r requirements/quality.txt
filelock==3.16.1
filelock==3.17.0
# via
# -r requirements/ci.txt
# tox
# virtualenv
id==1.5.0
# via
# -r requirements/quality.txt
# twine
idna==3.10
# via
# -r requirements/quality.txt
# requests
importlib-metadata==8.5.0
importlib-metadata==8.6.1
# via
# -r requirements/quality.txt
# keyring
Expand Down Expand Up @@ -194,7 +198,7 @@ more-itertools==10.6.0
# -r requirements/quality.txt
# jaraco-classes
# jaraco-functools
newrelic==10.4.0
newrelic==10.5.0
# via
# -r requirements/quality.txt
# edx-django-utils
Expand All @@ -218,10 +222,6 @@ pbr==6.1.0
# stevedore
pip-tools==7.4.1
# via -r requirements/pip-tools.txt
pkginfo==1.12.0
# via
# -r requirements/quality.txt
# twine
platformdirs==4.3.6
# via
# -r requirements/ci.txt
Expand Down Expand Up @@ -274,15 +274,15 @@ pylint-plugin-utils==0.8.2
# -r requirements/quality.txt
# pylint-celery
# pylint-django
pymongo==4.10.1
pymongo==4.11
# via
# -r requirements/quality.txt
# edx-opaque-keys
pynacl==1.5.0
# via
# -r requirements/quality.txt
# edx-django-utils
pyproject-api==1.8.0
pyproject-api==1.9.0
# via
# -r requirements/ci.txt
# tox
Expand Down Expand Up @@ -315,6 +315,7 @@ readme-renderer==44.0
requests==2.32.3
# via
# -r requirements/quality.txt
# id
# requests-toolbelt
# twine
requests-toolbelt==1.0.0
Expand Down Expand Up @@ -360,9 +361,9 @@ tomlkit==0.13.2
# via
# -r requirements/quality.txt
# pylint
tox==4.23.2
tox==4.24.1
# via -r requirements/ci.txt
twine==6.0.1
twine==6.1.0
# via -r requirements/quality.txt
typing-extensions==4.12.2
# via
Expand Down
17 changes: 9 additions & 8 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ asgiref==3.8.1
# via
# -r requirements/test.txt
# django
attrs==24.3.0
attrs==25.1.0
# via -r requirements/test.txt
babel==2.16.0
# via
Expand Down Expand Up @@ -95,13 +95,15 @@ fastavro==1.10.0
# via -r requirements/test.txt
h11==0.14.0
# via uvicorn
id==1.5.0
# via twine
idna==3.10
# via
# anyio
# requests
imagesize==1.4.1
# via sphinx
importlib-metadata==8.5.0
importlib-metadata==8.6.1
# via keyring
iniconfig==2.0.0
# via
Expand Down Expand Up @@ -136,7 +138,7 @@ more-itertools==10.6.0
# via
# jaraco-classes
# jaraco-functools
newrelic==10.4.0
newrelic==10.5.0
# via
# -r requirements/test.txt
# edx-django-utils
Expand All @@ -153,8 +155,6 @@ pbr==6.1.0
# via
# -r requirements/test.txt
# stevedore
pkginfo==1.12.0
# via twine
pluggy==1.5.0
# via
# -r requirements/test.txt
Expand All @@ -177,7 +177,7 @@ pygments==2.19.1
# readme-renderer
# rich
# sphinx
pymongo==4.10.1
pymongo==4.11
# via
# -r requirements/test.txt
# edx-opaque-keys
Expand Down Expand Up @@ -209,6 +209,7 @@ readme-renderer==44.0
# via twine
requests==2.32.3
# via
# id
# requests-toolbelt
# sphinx
# twine
Expand Down Expand Up @@ -267,7 +268,7 @@ sqlparse==0.5.3
# via
# -r requirements/test.txt
# django
starlette==0.45.2
starlette==0.45.3
# via sphinx-autobuild
stevedore==5.4.0
# via
Expand All @@ -280,7 +281,7 @@ text-unidecode==1.3
# via
# -r requirements/test.txt
# python-slugify
twine==6.0.1
twine==6.1.0
# via -r requirements/doc.in
typing-extensions==4.12.2
# via
Expand Down
Loading