Skip to content

Conversation

@karbassi
Copy link
Member

No description provided.

karbassi added 3 commits July 24, 2025 20:36
- Remove [tool.black] and [tool.isort] configuration sections
- Add ruff>=0.8.0 as development dependency
- Configure [tool.ruff] with line-length=79, target-version=py311
- Set up [tool.ruff.format] with Black-compatible settings
- Configure [tool.ruff.isort] with Django-aware import sorting
- Add [tool.ruff.lint] with basic linting rules (E, F, W, I)
- Exclude migrations directory from formatting and linting

This maintains existing code style while consolidating formatting,
import sorting, and linting into a single faster tool.
- Update pre-commit configuration to use Ruff instead of Black/isort
- Add Ruff as development dependency in pyproject.toml
- Configure Ruff with Django-aware import sorting and formatting rules
- Apply Ruff formatting across entire codebase:
  - Fix import ordering and grouping
  - Remove unused imports and variables
  - Fix string formatting (remove f-string prefixes where unnecessary)
  - Improve code style consistency
  - Fix minor linting issues (unused variables, comparison style)
- Update task completion status in migration spec
- Maintain existing line length and formatting preferences

This migration consolidates two tools (Black + isort) into one (Ruff) while
maintaining code quality standards and improving development workflow efficiency.
@karbassi karbassi requested a review from Copilot July 25, 2025 02:16
@karbassi karbassi linked an issue Jul 25, 2025 that may be closed by this pull request

This comment was marked as outdated.

karbassi added 5 commits July 24, 2025 21:20
- Update tech.md to reference Ruff as combined linter and formatter
- Update structure.md to use Ruff for formatting and import sorting
- Maintain 79-character line length configuration
- Preserve Django-aware import sorting documentation
- Remove custom line-length setting (79 -> 88 chars default)
- Remove custom exclude patterns, using Ruff's built-in defaults
- Remove custom lint rule selections, using recommended rule set
- Remove custom isort and format configurations
- Keep Django-specific __init__.py wildcard import allowance
- Update documentation to reflect simplified configuration
- Test formatting compatibility with existing codebase
- Verify import sorting functionality and Django-aware organization
- Validate pre-commit hooks execute correctly in containerized environment
- Confirm migration files are properly excluded from formatting
- Fix 31 import sorting issues and reformat 25 files during testing
- All Ruff functionality working as expected with proper exclusion patterns
- Move linter settings to [tool.ruff.lint] section
- Remove COM812 rule to avoid conflicts with formatter
- Add COM812 to ignore list to prevent formatter conflicts
- Maintain all existing rule selections and configurations

Resolves warnings about deprecated top-level linter settings and
formatter conflicts with COM812 rule.
@karbassi karbassi requested a review from Copilot July 25, 2025 03:19

This comment was marked as outdated.

@karbassi karbassi temporarily deployed to website-1510-replace-bl-jhce7e July 25, 2025 03:23 Inactive
karbassi and others added 4 commits July 24, 2025 22:25
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@karbassi karbassi requested a review from Copilot July 25, 2025 03:27

This comment was marked as outdated.

karbassi and others added 2 commits July 24, 2025 22:28
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@karbassi karbassi requested a review from Copilot July 25, 2025 03:29

This comment was marked as outdated.

@karbassi karbassi requested a review from Copilot July 25, 2025 03:38

This comment was marked as outdated.

@karbassi karbassi requested a review from Copilot July 25, 2025 03:41

This comment was marked as outdated.

- None values: Sets them to 0
- Negative values: Sets them to 0
- Positive values: Leaves them unchanged

This preserves the original intent of the code while being more readable than the redundant max() calls.
@karbassi karbassi requested a review from Copilot July 25, 2025 03:45
Copy link
Contributor

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 pull request migrates the codebase from Black and isort to Ruff for Python code formatting and linting. The migration consolidates two tools into one faster alternative while maintaining the same code style standards.

  • Replaced Black and isort configuration with comprehensive Ruff setup in pyproject.toml
  • Updated pre-commit hooks to use Ruff instead of Black and isort
  • Applied automatic formatting changes throughout the codebase including f-string removal, import reorganization, and trailing comma additions

Reviewed Changes

Copilot reviewed 58 out of 59 changed files in this pull request and generated 4 comments.

File Description
pyproject.toml Replaced Black/isort config with comprehensive Ruff configuration and added Ruff dependency
.pre-commit-config.yaml Updated hooks to use Ruff instead of Black and isort
Various Python files Applied Ruff formatting including f-string simplification, import sorting, and style fixes
Documentation files Updated references from Black/isort to Ruff in project documentation
Comments suppressed due to low confidence (1)

coderdojochi/util.py:29

  • [nitpick] The error message is overly verbose and redundant. Consider simplifying to: "Missing required parameters: subject, template_name, and recipients are required"
        raise ValueError("Missing required parameters: 'subject', 'template_name', and 'recipients' are all required.")

@karbassi karbassi temporarily deployed to website-1510-replace-bl-pvpxsc July 25, 2025 03:52 Inactive
@karbassi karbassi merged commit d386aba into main Jul 25, 2025
2 checks passed
@karbassi karbassi deleted the 1510-replace-black-with-ruff branch July 25, 2025 03:54
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.

Replace Black with Ruff

2 participants