Title: Add prek hook to forbid banned comment keywords (pragma:, type: ignore) by Copilot · Pull Request #1833 · usethis-python/usethis-python · GitHub
Open Graph Title: Add prek hook to forbid banned comment keywords (pragma:, type: ignore) by Copilot · Pull Request #1833 · usethis-python/usethis-python
X Title: Add prek hook to forbid banned comment keywords (pragma:, type: ignore) by Copilot · Pull Request #1833 · usethis-python/usethis-python
Description: Agents and developers occasionally introduce # pragma: no cover or # type: ignore[...] comments. This project doesn't use coverage pragmas (write tests instead) and uses pyright, not mypy, for type checking. New hook: hooks/check-comment-keywords.py Uses Python's tokenize module to inspect only comment tokens — no false positives from strings or docstrings Accepts --keyword (repeatable) via CLI, keeping the script project-agnostic Wired into .pre-commit-config.yaml applying to all Python files via types: [python]: - id: check-comment-keywords name: check-comment-keywords entry: uv run --frozen --offline hooks/check-comment-keywords.py args: ["--keyword", "pragma:", "--keyword", "type: ignore"] language: system types: [python] priority: 0 Cleanup of existing violations Removed 6 # type: ignore[union-attr] comments from src/usethis/_deps.py and src/usethis/_file/pyproject_toml/deps.py — these were mypy suppressions unnecessary under ty/basedpyright Skills used: usethis-prek-hook-bespoke-create, usethis-qa-static-checks, usethis-lesson-create, usethis-github-issue-create
Open Graph Description: Agents and developers occasionally introduce # pragma: no cover or # type: ignore[...] comments. This project doesn't use coverage pragmas (write tests instead) and uses pyright, not mypy, for ...
X Description: Agents and developers occasionally introduce # pragma: no cover or # type: ignore[...] comments. This project doesn't use coverage pragmas (write tests instead) and uses pyright, not mypy, ...
Opengraph URL: https://github.com/usethis-python/usethis-python/pull/1833
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:3365ff2c-a41f-1a15-ab65-8f81fba280fd |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9E9A:31A9ED:41E69:5D977:6A4DB869 |
| html-safe-nonce | 1ec2a75a5e2f171239a1a0378b45e6ed21f40647efa247cd62bf937a93b7e59c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTlBOjMxQTlFRDo0MUU2OTo1RDk3Nzo2QTREQjg2OSIsInZpc2l0b3JfaWQiOiIzNDM1MDUxMDM5MDkwMTI5MDAxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ea19ab5b430feaf9b2c90602f4fbc9d292224b8e45d0510ece1027a1fd60e412 |
| hovercard-subject-tag | pull_request:3495836263 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/usethis-python/usethis-python/pull/1833/files |
| twitter:image | https://avatars.githubusercontent.com/in/1143301?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/in/1143301?s=400&v=4 |
| og:image:alt | Agents and developers occasionally introduce # pragma: no cover or # type: ignore[...] comments. This project doesn't use coverage pragmas (write tests instead) and uses pyright, not mypy, for ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/usethis-python/usethis-python git https://github.com/usethis-python/usethis-python.git |
| octolytics-dimension-user_id | 216362695 |
| octolytics-dimension-user_login | usethis-python |
| octolytics-dimension-repository_id | 842189705 |
| octolytics-dimension-repository_nwo | usethis-python/usethis-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 842189705 |
| octolytics-dimension-repository_network_root_nwo | usethis-python/usethis-python |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 32f7b614aca06e6bbd89842b1370df1328264f68 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width