Skip to content

Commit c65cd52

Browse files
committed
style: Fix/Ignore linting issues.
1 parent d5306a2 commit c65cd52

File tree

6 files changed

+30
-28
lines changed

6 files changed

+30
-28
lines changed

backend/sample_plugin/apps.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class SamplePluginConfig(AppConfig):
4141
}
4242
4343
The platform automatically discovers and loads plugins registered in these entry points.
44-
""" # noqa:
44+
""" # pylint: disable=line-too-long # noqa: E501
4545

4646
default_auto_field = "django.db.models.BigAutoField"
4747
name = "sample_plugin"
@@ -98,7 +98,7 @@ class SamplePluginConfig(AppConfig):
9898
# }
9999
#
100100
# Documentation:
101-
# - PluginSignals: https://docs.openedx.org/projects/edx-django-utils/en/latest/plugins/how_tos/how_to_create_a_plugin_app.html#plugin-signals
101+
# - PluginSignals: https://docs.openedx.org/projects/edx-django-utils/en/latest/plugins/how_tos/how_to_create_a_plugin_app.html#plugin-signals # noqa: E501
102102
# - Open edX Events: https://docs.openedx.org/projects/openedx-events/en/latest/
103103
}
104104

@@ -130,4 +130,4 @@ def ready(self):
130130
"""
131131
# Import signal handlers to register Open edX Event receivers
132132
# This import registers all @receiver decorated functions in signals.py
133-
from . import signals # noqa: F401
133+
from . import signals # pylint: disable=import-outside-toplevel,unused-import

backend/sample_plugin/pipeline.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
- Data transformation and validation
3636
- Integration with external systems
3737
- Custom business logic implementation
38-
"""
38+
""" # pylint: disable=line-too-long
3939

4040
import logging
4141
import re
@@ -78,9 +78,9 @@ def plugin_settings(settings):
7878
- Add tracking parameters to URLs
7979
- Route different course types to different platforms
8080
- Implement A/B testing for course pages
81-
"""
81+
""" # noqa: E501
8282

83-
def run_filter(self, url, org, **kwargs):
83+
def run_filter(self, url, org, **kwargs): # pylint: disable=arguments-differ
8484
"""
8585
Modify the course about page URL.
8686
@@ -112,7 +112,7 @@ def run_filter(self, url, org, **kwargs):
112112
113113
Documentation:
114114
- run_filter method: https://docs.openedx.org/projects/openedx-filters/en/latest/reference/filters-tooling.html#openedx_filters.filters.PipelineStep.run_filter
115-
"""
115+
""" # noqa: E501
116116
# Extract course ID using Open edX course key pattern
117117
# Course keys follow the format: course-v1:ORG+COURSE+RUN
118118
pattern = r'(?P<course_id>course-v1:[^/]+)'

backend/sample_plugin/settings/common.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
1717
Settings Organization:
1818
- common.py: Settings for all environments
19-
- production.py: Production-specific overrides
19+
- production.py: Production-specific overrides
2020
- test.py: Test environment optimizations
2121
2222
Integration Points:
@@ -25,7 +25,7 @@
2525
- Database connection settings for plugin models
2626
- External service integration parameters
2727
- Feature flags and environment-specific toggles
28-
"""
28+
""" # noqa: E501
2929

3030
import logging
3131

@@ -48,11 +48,11 @@ def plugin_settings(settings):
4848
# Plugin-specific configuration
4949
settings.SAMPLE_PLUGIN_API_RATE_LIMIT = "60/minute"
5050
settings.SAMPLE_PLUGIN_ARCHIVE_RETENTION_DAYS = 365
51-
51+
5252
# External service integration
5353
settings.SAMPLE_PLUGIN_EXTERNAL_API_URL = "https://api.example.com"
5454
settings.SAMPLE_PLUGIN_API_KEY = "your-api-key"
55-
55+
5656
# Feature flags
5757
settings.SAMPLE_PLUGIN_ENABLE_ARCHIVING = True
5858
settings.SAMPLE_PLUGIN_ENABLE_NOTIFICATIONS = False
@@ -70,42 +70,42 @@ def plugin_settings(settings):
7070
"""
7171
# Plugin is configured but no additional settings needed for this basic example
7272
# Uncomment and modify the examples below for your use case:
73-
73+
7474
# Plugin-specific configuration
7575
# settings.SAMPLE_PLUGIN_API_RATE_LIMIT = "60/minute"
7676
# settings.SAMPLE_PLUGIN_ARCHIVE_RETENTION_DAYS = 365
77-
77+
7878
# Register Open edX Filters (additive approach)
7979
_configure_openedx_filters(settings)
8080

8181

8282
def _configure_openedx_filters(settings):
8383
"""
8484
Configure Open edX Filters for the sample plugin.
85-
85+
8686
This function demonstrates the proper way to register filters by:
8787
1. Preserving existing filter configuration from other plugins
8888
2. Adding our filter configuration additively
8989
3. Avoiding duplicate pipeline steps
9090
4. Logging configuration state for debugging
91-
91+
9292
Args:
9393
settings (dict): Django settings object
9494
"""
9595
# Get existing filter configuration (may be from other plugins or platform)
9696
filters_config = getattr(settings, 'OPEN_EDX_FILTERS_CONFIG', {})
97-
97+
9898
# Filter we want to register
9999
filter_name = "org.openedx.learning.course_about.page.url.requested.v1"
100100
our_pipeline_step = "sample_plugin.pipeline.ChangeCourseAboutPageUrl"
101-
101+
102102
# Check if this filter already has configuration
103103
if filter_name in filters_config:
104104
logger.debug(f"Filter {filter_name} already configured, adding our pipeline step")
105-
105+
106106
# Get existing pipeline steps
107107
existing_pipeline = filters_config[filter_name].get("pipeline", [])
108-
108+
109109
# Check if our pipeline step is already registered
110110
if our_pipeline_step in existing_pipeline:
111111
logger.info(
@@ -125,10 +125,10 @@ def _configure_openedx_filters(settings):
125125
"pipeline": [our_pipeline_step],
126126
"fail_silently": False,
127127
}
128-
128+
129129
# Update the settings object
130130
settings.OPEN_EDX_FILTERS_CONFIG = filters_config
131-
131+
132132
logger.debug(
133133
f"Final filter configuration for {filter_name}: "
134134
f"{filters_config.get(filter_name, {})}"

backend/sample_plugin/signals.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,17 @@
4242
- Synchronizing data with external databases
4343
"""
4444

45-
from openedx_events.content_authoring.signals import COURSE_CATALOG_INFO_CHANGED
46-
from openedx_events.content_authoring.data import CourseCatalogData
47-
from django.dispatch import receiver
4845
import logging
4946

47+
from django.dispatch import receiver
48+
from openedx_events.content_authoring.data import CourseCatalogData
49+
from openedx_events.content_authoring.signals import COURSE_CATALOG_INFO_CHANGED
50+
5051
logger = logging.getLogger(__name__)
5152

53+
5254
@receiver(COURSE_CATALOG_INFO_CHANGED)
53-
def log_course_info_changed(signal, sender, catalog_info: CourseCatalogData, **kwargs):
55+
def log_course_info_changed(signal, sender, catalog_info: CourseCatalogData, **kwargs): # pylint: disable=unused-argument # noqa: E501
5456
"""
5557
Handle course catalog information changes.
5658

backend/tests/__init__.py

Whitespace-only changes.

backend/tests/test_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def test_create_course_archive_status_without_user_field(api_client, user, cours
298298
if response.status_code != status.HTTP_201_CREATED:
299299
print(f"Response status: {response.status_code}")
300300
print(f"Response data: {response.data}")
301-
301+
302302
assert response.status_code == status.HTTP_201_CREATED
303303
assert response.data["course_id"] == str(course_key)
304304
assert response.data["user"] == user.id
@@ -378,7 +378,7 @@ def test_staff_update_with_explicit_user_override(
378378
initial_status = CourseArchiveStatus.objects.create(
379379
course_id=course_key, user=user, is_archived=False
380380
)
381-
381+
382382
api_client.force_authenticate(user=staff_user)
383383
url = reverse(
384384
"sample_plugin:course-archive-status-detail", args=[initial_status.id]
@@ -418,7 +418,7 @@ def test_regular_user_cannot_override_user_field_create(
418418
assert response.status_code == status.HTTP_403_FORBIDDEN
419419

420420

421-
@pytest.mark.django_db
421+
@pytest.mark.django_db
422422
def test_staff_create_without_user_field_defaults_to_current_user(
423423
api_client, staff_user, course_key
424424
):

0 commit comments

Comments
 (0)