stark256-spec commented on PR #3454: URL: https://github.com/apache/iceberg-python/pull/3454#issuecomment-4639395381
Circling back on the pre-commit change — the inline `# noqa: D105` approach I tried doesn't work with this linting stack, for two reasons: 1. **pydocstyle** doesn't process `# noqa` comments at all — that directive is a ruff/flake8 concept. pydocstyle ignores it and fires D105 anyway. 2. **ruff** then treats `# noqa: D105` as an unnecessary noqa directive (RUF100 — D105 is not a ruff code), auto-strips the comment, and fails the hook because it modified the file. The underlying issue is an inherent catch-22 in the `@overload` stubs for `__getitem__`: - D105 fires because `@overload` stubs are magic methods with no docstring - D418 fires if you *add* a docstring to an `@overload` stub - Neither `# noqa` nor any inline suppression survives this stack The three options I can see: 1. **Add D105 to the global ignore** (what the original commit did) — one-line change, the stubs stay, type narrowing is preserved 2. **Drop the `@overload` stubs** — D105 goes away, but callers lose the narrowed return type (`T` vs `list[T]` depending on index vs slice) 3. **Use `type: ignore` comments** — these survive ruff but still don't suppress pydocstyle Happy to go with whatever direction you prefer. If option 1 is acceptable, I can push that immediately. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
