If it's true that running in pre-commit always needs --force-exclude to work properly, then you can set it as part of the entry, such as:
entry: ruff --force-exclude
This will then always include this option when running, regardless of what args is set to. Assume ruff is fine if this is passed twice (for backward compatibly with existing user's args:), then this is the recommended way to do this (for an example, see https://github.com/pre-commit/mirrors-clang-format/blob/ea59a72ffc9a1ce6b79b02a8076d031aa7ea7805/.pre-commit-hooks.yaml#L4 ).
If it's not the case that this (or any other flag) is always required for pre-commit, then nevermind. :)
If it's true that running in pre-commit always needs
--force-excludeto work properly, then you can set it as part of the entry, such as:This will then always include this option when running, regardless of what args is set to. Assume ruff is fine if this is passed twice (for backward compatibly with existing user's
args:), then this is the recommended way to do this (for an example, see https://github.com/pre-commit/mirrors-clang-format/blob/ea59a72ffc9a1ce6b79b02a8076d031aa7ea7805/.pre-commit-hooks.yaml#L4 ).If it's not the case that this (or any other flag) is always required for pre-commit, then nevermind. :)