-
-
Notifications
You must be signed in to change notification settings - Fork 563
Description
Issue: Remove deprecated Ruff configuration option
Problem
The Ruff formatter configuration in pyproject.toml contains a deprecated option ignore-init-module-imports that is generating warnings during execution. This option was used to control how Ruff handles imports in __init__.py files, but Ruff now correctly handles these imports by default, making this configuration obsolete.
Impact
When running Ruff (linting, formatting, or checking), users encounter the following deprecation warning:
warning: The `ignore-init-module-imports` option is deprecated and will be removed in a future release.
This causes:
- Unnecessary warning noise in CI/CD pipelines
- Confusion for contributors who may not understand why the warning appears
- Technical debt as the option will be removed in a future Ruff release
- Risk of build failures when Ruff eventually removes this option entirely
Root Cause
The ignore-init-module-imports = true setting in the [tool.ruff.lint] section of pyproject.toml is no longer necessary. Ruff's behavior has evolved to handle __init__.py imports correctly by default, eliminating the need for this explicit configuration.
Proposed Solution
Remove the deprecated ignore-init-module-imports = true line from the [tool.ruff.lint] section in pyproject.toml.
This is a single-line deletion with no functional impact on the codebase:
- ✅ Eliminates the deprecation warning
- ✅ Aligns with Ruff's latest best practices
- ✅ Prevents future breaking changes when Ruff removes this option
- ✅ No changes to linting or formatting behavior (Ruff handles this correctly by default)
Benefits
- Cleaner output: Removes unnecessary warnings from development and CI/CD workflows
- Future-proof: Prevents potential issues when Ruff removes this deprecated option
- Best practices: Keeps the configuration aligned with Ruff's current recommendations
- Minimal change: Single line deletion with no side effects
Additional Context
- Ruff version where option became deprecated: The exact version varies, but this has been deprecated in recent Ruff releases
- This change has been tested in a fork and confirmed to work correctly without any adverse effects
- The Ruff documentation confirms that this option is no longer needed as the default behavior is now correct
Testing
After making this change:
- ✅ Run
ruff check- should complete without deprecation warnings - ✅ Run
ruff format- should complete without deprecation warnings - ✅ Verify existing tests pass
- ✅ Verify no changes to actual linting/formatting behavior