Skip to content

Commit 4f7ccd7

Browse files
committed
cleanup linting
1 parent bba7401 commit 4f7ccd7

38 files changed

+1885
-1609
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,32 +50,28 @@ jobs:
5050
lint:
5151
name: Lint and Format Check
5252
runs-on: ubuntu-latest
53-
53+
5454
steps:
5555
- name: Checkout code
5656
uses: actions/checkout@v4
57-
57+
5858
- name: Set up Python
5959
uses: actions/setup-python@v5
6060
with:
6161
python-version: '3.11'
62-
62+
6363
- name: Install dependencies
6464
run: |
6565
python -m pip install --upgrade pip
66-
pip install black isort flake8
67-
68-
- name: Check code formatting with Black
69-
run: |
70-
black --check django_forms_workflows/
71-
72-
- name: Check import sorting with isort
66+
pip install ruff
67+
68+
- name: Check code formatting with Ruff
7369
run: |
74-
isort --check-only django_forms_workflows/
75-
76-
- name: Lint with flake8
70+
ruff format --check django_forms_workflows/
71+
72+
- name: Lint with Ruff
7773
run: |
78-
flake8 django_forms_workflows/ --max-line-length=120 --extend-ignore=E203,W503
74+
ruff check django_forms_workflows/
7975
8076
build:
8177
name: Build Package

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist

CHANGELOG.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
- Advanced reporting and analytics
1616
- Multi-tenancy support
1717

18-
## [0.2.0] - TBD
18+
## [0.2.2] - 2025-10-31
19+
20+
### Changed
21+
- **Code Quality Improvements**
22+
- Migrated from Black to Ruff for code formatting and linting
23+
- Fixed all import ordering and type annotation issues
24+
- Added comprehensive ruff.toml configuration
25+
- Updated CI workflow to use Ruff instead of Black/isort/flake8
26+
- Improved LDAP availability checks using importlib.util.find_spec
27+
28+
### Fixed
29+
- Removed all references to "Campus Cafe" from codebase and documentation
30+
- Updated example database references to use generic "hr_database" naming
31+
- Cleaned up unused imports in LDAP handlers
32+
33+
## [0.2.1] - 2025-10-31
34+
35+
### Fixed
36+
- Corrected author email in package metadata from `[email protected]` to `[email protected]`
37+
38+
## [0.2.0] - 2025-10-31
1939

2040
### Added - Configurable Prefill Sources
2141
- **PrefillSource Model** - Database-driven prefill source configuration
@@ -164,7 +184,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
164184
- psycopg2-binary >= 2.9 (for PostgreSQL)
165185
- mysqlclient >= 2.2 (for MySQL)
166186

167-
[Unreleased]: https://github.com/opensensor/django-forms-workflows/compare/v0.2.0...HEAD
187+
[Unreleased]: https://github.com/opensensor/django-forms-workflows/compare/v0.2.2...HEAD
188+
[0.2.2]: https://github.com/opensensor/django-forms-workflows/compare/v0.2.1...v0.2.2
189+
[0.2.1]: https://github.com/opensensor/django-forms-workflows/compare/v0.2.0...v0.2.1
168190
[0.2.0]: https://github.com/opensensor/django-forms-workflows/compare/v0.1.0...v0.2.0
169191
[0.1.0]: https://github.com/opensensor/django-forms-workflows/releases/tag/v0.1.0
170192

-78.9 KB
Binary file not shown.
-59.2 KB
Binary file not shown.

django_forms_workflows/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
Enterprise-grade, database-driven form builder with approval workflows
44
"""
55

6-
__version__ = '0.2.1'
7-
__author__ = 'Django Forms Workflows Contributors'
8-
__license__ = 'LGPL-3.0-only'
9-
10-
default_app_config = 'django_forms_workflows.apps.DjangoFormsWorkflowsConfig'
6+
__version__ = "0.2.2"
7+
__author__ = "Django Forms Workflows Contributors"
8+
__license__ = "LGPL-3.0-only"
119

10+
default_app_config = "django_forms_workflows.apps.DjangoFormsWorkflowsConfig"

django_forms_workflows/admin.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
Provides a friendly admin interface to build forms (with fields),
55
configure approval workflows, and review submissions and audit logs.
66
"""
7+
78
from django.contrib import admin
8-
from django.utils.html import format_html
9+
910
from .models import (
11+
ApprovalTask,
12+
AuditLog,
1013
FormDefinition,
1114
FormField,
12-
PrefillSource,
13-
PostSubmissionAction,
14-
WorkflowDefinition,
1515
FormSubmission,
16-
ApprovalTask,
17-
AuditLog,
16+
PostSubmissionAction,
17+
PrefillSource,
1818
UserProfile,
19+
WorkflowDefinition,
1920
)
2021

2122

@@ -51,7 +52,12 @@ class FormFieldInline(admin.StackedInline):
5152
"Choices & Defaults",
5253
{
5354
"classes": ("collapse",),
54-
"fields": ("choices", "prefill_source_config", "prefill_source", "default_value"),
55+
"fields": (
56+
"choices",
57+
"prefill_source_config",
58+
"prefill_source",
59+
"default_value",
60+
),
5561
},
5662
),
5763
(
@@ -327,9 +333,7 @@ class PostSubmissionActionAdmin(admin.ModelAdmin):
327333
"condition_field",
328334
("condition_operator", "condition_value"),
329335
),
330-
"description": (
331-
"Execute this action only when the condition is met."
332-
),
336+
"description": ("Execute this action only when the condition is met."),
333337
},
334338
),
335339
(
@@ -431,4 +435,3 @@ class UserProfileAdmin(admin.ModelAdmin):
431435
search_fields = ("user__username", "user__email", "department", "title")
432436
raw_id_fields = ("user", "manager")
433437
list_filter = ("department",)
434-

django_forms_workflows/apps.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@
77

88
class DjangoFormsWorkflowsConfig(AppConfig):
99
"""App configuration for Django Forms Workflows"""
10-
11-
default_auto_field = 'django.db.models.BigAutoField'
12-
name = 'django_forms_workflows'
13-
verbose_name = 'Forms Workflows'
14-
10+
11+
default_auto_field = "django.db.models.BigAutoField"
12+
name = "django_forms_workflows"
13+
verbose_name = "Forms Workflows"
14+
1515
def ready(self):
1616
"""
1717
Import signal handlers and perform app initialization.
1818
"""
1919
# Import signals if you have any
2020
# from . import signals
2121
pass
22-

django_forms_workflows/data_sources/__init__.py

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,36 @@
99
1010
Usage:
1111
from django_forms_workflows.data_sources import get_data_source
12-
12+
1313
source = get_data_source('ldap')
1414
value = source.get_value(user, 'department')
1515
"""
1616

1717
from .base import DataSource, DataSourceRegistry
18-
from .user_source import UserDataSource
19-
from .ldap_source import LDAPDataSource
2018
from .database_source import DatabaseDataSource
19+
from .ldap_source import LDAPDataSource
20+
from .user_source import UserDataSource
2121

2222
# Global registry
2323
registry = DataSourceRegistry()
2424

2525
# Register built-in sources
26-
registry.register('user', UserDataSource)
27-
registry.register('ldap', LDAPDataSource)
28-
registry.register('database', DatabaseDataSource)
29-
registry.register('db', DatabaseDataSource) # Alias
26+
registry.register("user", UserDataSource)
27+
registry.register("ldap", LDAPDataSource)
28+
registry.register("database", DatabaseDataSource)
29+
registry.register("db", DatabaseDataSource) # Alias
3030

3131

3232
def get_data_source(source_type):
3333
"""
3434
Get a data source instance by type.
35-
35+
3636
Args:
3737
source_type: Type of data source ('user', 'ldap', 'database', etc.)
38-
38+
3939
Returns:
4040
DataSource instance
41-
41+
4242
Raises:
4343
ValueError: If source type is not registered
4444
"""
@@ -48,32 +48,31 @@ def get_data_source(source_type):
4848
def register_data_source(source_type, source_class):
4949
"""
5050
Register a custom data source.
51-
51+
5252
Args:
5353
source_type: Unique identifier for the source
5454
source_class: DataSource subclass
55-
55+
5656
Example:
5757
from django_forms_workflows.data_sources import register_data_source, DataSource
58-
58+
5959
class SalesforceSource(DataSource):
6060
def get_value(self, user, field_name, **kwargs):
6161
# Query Salesforce API
6262
pass
63-
63+
6464
register_data_source('salesforce', SalesforceSource)
6565
"""
6666
registry.register(source_type, source_class)
6767

6868

6969
__all__ = [
70-
'DataSource',
71-
'DataSourceRegistry',
72-
'UserDataSource',
73-
'LDAPDataSource',
74-
'DatabaseDataSource',
75-
'get_data_source',
76-
'register_data_source',
77-
'registry',
70+
"DataSource",
71+
"DataSourceRegistry",
72+
"UserDataSource",
73+
"LDAPDataSource",
74+
"DatabaseDataSource",
75+
"get_data_source",
76+
"register_data_source",
77+
"registry",
7878
]
79-

0 commit comments

Comments
 (0)