diff --git a/src/community_of_python_flake8_plugin/constants.py b/src/community_of_python_flake8_plugin/constants.py index 6721bab..4ddb832 100644 --- a/src/community_of_python_flake8_plugin/constants.py +++ b/src/community_of_python_flake8_plugin/constants.py @@ -81,6 +81,7 @@ "set", "should", "update", + "replace", "write", "obtain", "perform", diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 0b4269b..3debfd9 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -155,6 +155,11 @@ def test_type_annotation_validations(input_source: str, expected_output: list[st ("def _total_value() -> int:\n return 1", ["COP009"]), # No violation: get_ prefix is allowed for sync functions ("def get_user_data() -> str:\n return 'value'", []), + # No violation: replacement is a supported operation verb + ("def replace_item() -> None:\n ...", []), + ("async def replace_item() -> None:\n ...", []), + ("def _replace_item() -> None:\n ...", []), + ("def __replace_item() -> None:\n ...", []), # COP010: Avoid get_ prefix in async function names ("async def get_user_data() -> str:\n return 'value'", ["COP010"]), # COP009: Function name must be a verb (even with mutable params)