mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-07-09 20:51:05 +02:00
refactor: reduce return-count complexity (#1153)
## ℹ️ Description This refactor reduces return-count complexity for the next PLR0911 ratchet while preserving existing behavior. No related issue. ## 📋 Changes Summary - Extract German and English pluralization helpers while keeping translation and prefix handling in `pluralize()`. - Remove one early return from `check_for_updates()` by sharing the existing final state update/save path. - Ratchet Ruff `PLR0911` `max-returns` from 12 to 10. - Document the one-lower discovery result: `check_for_updates()` is the next limiter at 10 returns for `max-returns = 9`. - No dependencies, configuration requirements, documentation updates, or generated artifacts are introduced. ### ⚙️ Type of Change Select the type(s) of change(s) included in this pull request: - [ ] 🐞 Bug fix (non-breaking change which fixes an issue) - [ ] ✨ New feature (adds new functionality without breaking existing usage) - [ ] 💥 Breaking change (changes that might break existing user setups, scripts, or configurations) ## ✅ Checklist Before requesting a review, confirm the following: - [x] I have reviewed my changes to ensure they meet the project's standards. - [x] I have tested my changes and ensured that all tests pass (`pdm run test`). - [x] I have formatted the code (`pdm run format`). - [x] I have verified that linting passes (`pdm run lint`). - [x] I have updated documentation where necessary. No documentation changes were needed. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Reorganized pluralization logic and simplified update-checking control flow for improved code maintainability. * **Tests** * Expanded test coverage for pluralization with additional German and English language variations. * **Chores** * Updated code quality configuration standards. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -292,7 +292,7 @@ max-args = 6 # max. number of args for function / method (R0913)
|
||||
# max-attributes = 15 # TODO max. number of instance attrs for a class (R0902)
|
||||
max-branches = 42 # max. number of branch for function / method body (R0912)
|
||||
max-locals = 27 # max. number of local vars for function / method body (R0914)
|
||||
max-returns = 12 # max. number of return / yield for function / method body (R0911)
|
||||
max-returns = 10 # max. number of return / yield for function / method body (R0911)
|
||||
max-statements = 115 # max. number of statements in function / method body (R0915)
|
||||
max-public-methods = 20 # max. number of public methods for a class (R0904)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user