Skip to content

Fix/codacy pydocstyle issues#1635

Closed
yechielb2000 wants to merge 4 commits intoatlassian-api:masterfrom
yechielb2000:fix/codacy-pydocstyle-issues
Closed

Fix/codacy pydocstyle issues#1635
yechielb2000 wants to merge 4 commits intoatlassian-api:masterfrom
yechielb2000:fix/codacy-pydocstyle-issues

Conversation

@yechielb2000
Copy link
Copy Markdown

No description provided.

Yechiel Babani and others added 4 commits April 12, 2026 21:33
Introduce a new `atlassian.models.jira` package that eliminates manual
JSON/dictionary construction for Jira operations in favor of typed
dataclasses, fluent builders, and a centralized serializer.

Core modules:
- fields.py: frozen value-object dataclasses (Project, Priority, User, etc.)
  with to_dict()/from_dict() for (de)serialization
- issues.py: JiraIssue base + Task/Bug/Story/Epic/SubTask with
  __init_subclass__ auto-registry
- builders.py: generic IssueBuilder[T] with per-type builders, ADF bridge
  pattern, and .validate() chaining
- serializer.py: FieldMapping + serialize()/to_fields_dict()/bulk_serialize()
- adf.py: ADFBuilder for Atlassian Document Format rich-text descriptions
- validation.py: pre-flight validate()/validate_or_raise()
- update.py: UpdateBuilder for issue_update with set/add/remove operations
- transition.py: Transition model for set_issue_status()
- comment.py: Comment + Visibility for issue_add_comment()

Also adds py.typed marker, convenience import alias (atlassian.jira_models),
and 86 tests covering all modules.
Add type-safe Jira issue models with fluent builders
- Remove unused imports (CustomField in serializer.py, Any in validation.py)
- Reduce cyclomatic complexity of serialize() and IssueFields.from_dict()
  by extracting helper functions
- Apply black formatter (line-length=120, target py39/py310/py311)
- All flake8 checks pass, all 86 tests pass
- Eliminate code duplication in fields.py: extract _NameIdEntity and
  _KeyIdEntity base classes for 6 near-identical value-object dataclasses
- Eliminate duplication in update.py: extract _entity_op and
  _set_entity_list helpers for repetitive add/remove/set methods
- Fix W0622: rename id params to id_ in builders.py and update.py
- Fix D401: reword to_fields_dict docstring to imperative mood
- Fix D212: all multi-line docstrings use summary-on-first-line style
- Fix D105: all magic methods (__post_init__, __init__, etc.) have docstrings
- Fix D416: all section headers end with colon
- Fix R0913: reduce _entity_op args from 6 to 4
- Suppress R0902 on IssueFields (18 attrs inherent to Jira data model)
- Suppress R0904 on IssueBuilder/UpdateBuilder (fluent builder pattern)
- Suppress C0415 on circular import workaround in IssueFields.from_dict
- All pylint scores 10.00/10, black/flake8/bandit clean, 86 tests pass

Note: D203 (blank line before class docstring) conflicts with Black
formatter which is enforced in project CI. Black removes these blank
lines (D211 style). This is an unresolvable Codacy/Black conflict.
@yechielb2000 yechielb2000 deleted the fix/codacy-pydocstyle-issues branch April 12, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant