Skip to content

Add keyword_only_ignore_private configuration option#33

Open
mortenkrane wants to merge 3 commits intomainfrom
claude/optional-named-args-private-Lejcy
Open

Add keyword_only_ignore_private configuration option#33
mortenkrane wants to merge 3 commits intomainfrom
claude/optional-named-args-private-Lejcy

Conversation

@mortenkrane
Copy link

Summary

This PR adds a new configuration option keyword_only_ignore_private to allow users to exclude private functions and methods (those prefixed with _) from the keyword-only parameter check (ODA007).

Key Changes

  • Configuration: Added keyword_only_ignore_private boolean field to ProjectConfig class with a default value of False
  • Checker Logic: Updated KeywordOnlyChecker._check_function() to skip private functions when the configuration option is enabled
  • Documentation: Added configuration section to README.md explaining the new option
  • Tests: Added comprehensive test coverage including:
    • Private functions checked by default
    • Private functions ignored when configured
    • Public functions still checked when private functions are ignored
    • Private methods ignored when configured
    • Explicit false configuration still checks private functions

Implementation Details

  • The check specifically targets functions/methods starting with _ (but excludes dunder methods which are already skipped)
  • The configuration is read from pyproject.toml under [tool.oida] section
  • Defaults to false to maintain backward compatibility and existing behavior
  • Works for both standalone functions and class methods

https://claude.ai/code/session_01VBusSyBThf162jT5wrKF8j

claude and others added 2 commits February 16, 2026 13:35
Add `keyword_only_ignore_private` option to `[tool.oida]` in pyproject.toml.
When set to `true`, functions prefixed with `_` are excluded from the ODA007
keyword-only parameter enforcement in service/selector modules.

https://claude.ai/code/session_01VBusSyBThf162jT5wrKF8j
Copy link

@geipette geipette left a comment

Choose a reason for hiding this comment

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

Nice!

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.

4 participants