Skip to content

Conversation

@crccheck
Copy link
Owner

@crccheck crccheck commented Mar 27, 2025

Bringing in rules I've had success with elsewhere. More consistent style helps with readability and maintainability. Some of the rules help with code simplicity and with reducing bugs too.

@crccheck crccheck requested a review from Copilot March 27, 2025 03:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the codebase by adding new lint rules to enforce a more consistent style and improve code readability. It includes updates to lint configuration in pyproject.toml, import reordering, and minor adjustments to return statements and test file imports.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pyproject.toml Added new lint rules and adjusted ignore configuration.
django_object_actions/init.py Reordered imports and updated all ordering.
django_object_actions/utils.py Reordered URL imports and added exception chaining in dispatch.
example_project/polls/admin.py Adjusted import ordering and made an explicit return in a view method.
example_project/polls/migrations/0002_auto_*.py Reordered migration imports for consistency.
example_project/polls/migrations/0001_initial.py Reordered migration imports for consistency.
django_object_actions/tests/test_admin.py Improved import ordering by removing duplicate imports.
example_project/urls.py Reordered import lines for clarity.
example_project/polls/factories.py Simplified the get_random_string implementation.
django_object_actions/tests/tests.py Minor changes to import order for clarity.
django_object_actions/tests/test_utils.py Adjusted import ordering in tests for consistency.

@crccheck crccheck marked this pull request as ready for review March 27, 2025 03:28
except KeyError:
raise Http404("Action does not exist")
except KeyError as exc:
raise Http404("Action does not exist") from exc
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL raise from https://peps.python.org/pep-3134/

from 2005!

@crccheck crccheck merged commit fa2b4d7 into main Apr 1, 2025
13 checks passed
@crccheck crccheck deleted the more-lint branch April 1, 2025 05:30
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.

3 participants