Title: Applying more Ruff groups to this repository · Issue #13295 · python/typeshed · GitHub
Open Graph Title: Applying more Ruff groups to this repository · Issue #13295 · python/typeshed
X Title: Applying more Ruff groups to this repository · Issue #13295 · python/typeshed
Description: The current selection of Ruff rules comes as a direct translation from when we were using isort, pyupgrade, pycln, Flake8, and some plugins. It made perfect sense at the time to restrict ourselves to only the most necessary rules, as add...
Open Graph Description: The current selection of Ruff rules comes as a direct translation from when we were using isort, pyupgrade, pycln, Flake8, and some plugins. It made perfect sense at the time to restrict ourselves ...
X Description: The current selection of Ruff rules comes as a direct translation from when we were using isort, pyupgrade, pycln, Flake8, and some plugins. It made perfect sense at the time to restrict ourselves ...
Opengraph URL: https://github.com/python/typeshed/issues/13295
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Applying more Ruff groups to this repository","articleBody":"The current selection of Ruff rules comes as a direct translation from when we were using isort, pyupgrade, pycln, Flake8, and some plugins.\nIt made perfect sense at the time to restrict ourselves to only the most necessary rules, as additional linters and tooling to be installed and run could mean an increase in CI runtime, security risks, upgrade maintenance, and complications between incompatible versions of libraries.\n\nBut with Ruff, the context is completely different. It is so fast than any additional rule group is negligible on the runtime and it's a single dependency. Which means that we could enable more rule groups w/o much concerns to help keep our growing non-stubs code up to the best standards. And explore more lints that could be beneficial to stubs.\n\nAs a side effect, we get to test various Ruff rules on a very 3rd-party type-stubs-driven repository, helping catch edge-cases and rules that don't belong in that context. This, in my opinion, would further bolster the existing collaboration between Ruff and typeshed, as well as indirectly help the Python typing community that also uses Ruff.\n\n---\n\nI'm already ready with an experiment PR to see the width and scale of changes this would entail with nearly all rules enabled.\nhttps://github.com/Avasam/typeshed/pull/39 (not something to be reviewed, just a launching point for me, like a possible \"todo list\")\nOf course I would go incrementally: starting with those that already pass as-is, then those covered by autofixes, individually splitting off the more massive ones, finishing with the manual interventions.\n\n---\n\n\u003cdetails>\n\u003csummary>Checklist\u003c/summary>\n\n- `Flake8`:\n - `Pyflakes (F)`: https://github.com/python/typeshed/pull/11496\n - `pycodestyle Error (E)`: https://github.com/python/typeshed/pull/11496\n - `pycodestyle Warning (W)`: https://github.com/python/typeshed/pull/11496\n - `mccabe (C90)`: ❌We don't actually mind long and complex tests. This is also very arbitrary, let's make that call on individual reviews\n- `isort (I)`: https://github.com/python/typeshed/pull/10912\n- `pep8-naming (N)`: https://github.com/python/typeshed/pull/13327\n- `pydocstyle (D)`: https://github.com/python/typeshed/pull/13326 & \n- `pyupgrade (UP)`: https://github.com/python/typeshed/pull/11499\n- `flake8-2020 (YTT)`: https://github.com/python/typeshed/pull/13314\n- `flake8-annotations (ANN)`: https://github.com/python/typeshed/pull/13331\n - ⚠Once https://github.com/python/typeshed/issues/9550 is complete, `ANN401` *could* be considered\n- `flake8-async (ASYNC)`: https://github.com/python/typeshed/pull/13727\n- `flake8-bandit (S)`: https://github.com/Avasam/typeshed/tree/Ruff-S-flake8-bandit\n- `flake8-blind-except (BLE)`: https://github.com/python/typeshed/pull/13728\n- `flake8-boolean-trap (FBT)`: ☑https://github.com/python/typeshed/pull/13751\n- `flake8-bugbear (B)`: https://github.com/python/typeshed/pull/11500 & https://github.com/python/typeshed/pull/13308\n- `flake8-builtins (A)`: https://github.com/python/typeshed/pull/13729\n- `flake8-commas (COM)`: ❌Already taken care of by, or conflict with, Black\n- `flake8-copyright (CPY)`: ❌Not using top-of-file copyright notices\n- `flake8-comprehensions (C4)`: ☑https://github.com/python/typeshed/pull/13751\n- `flake8-datetimez (DTZ)`: ☑https://github.com/python/typeshed/pull/13751\n- `flake8-debugger (T10)`: ☑https://github.com/python/typeshed/pull/13751\n- `flake8-django (DJ)`: ❌Not using Django at runtime\n- `flake8-errmsg (EM)`: https://github.com/python/typeshed/pull/13730\n- `flake8-executable (EXE)`: https://github.com/python/typeshed/pull/13346\n- `flake8-future-annotations (FA)`: https://github.com/python/typeshed/pull/10910\n- `flake8-implicit-str-concat (ISC)`: ❌Mostly taken care of by the formatter. And we allow both implicit and explicit multiline strings (to my dismay 😆)\n- `flake8-import-conventions (ICN)`: https://github.com/python/typeshed/pull/13731\n- `flake8-logging (LOG)`: ❌Not using logging at runtime\n- `flake8-logging-format (G)`: ❌Not using logging at runtime\n- `flake8-no-pep420 (INP)`: ❌Leave the decision at review to use [PEP 420](https://peps.python.org/pep-0420/)\n- `flake8-pie (PIE)`: https://github.com/python/typeshed/pull/13747\n- `flake8-print (T20)`: ❌We use print as a logging mechanism\n- `flake8-pyi (PYI)`: https://github.com/python/typeshed/pull/10458 and ongoing\n- `flake8-pytest-style (PT)`: ❌Not using pytest at runtime / in our test suite\n- `flake8-quotes (Q)`: ❌This should be fully covered by formatters (whether Black or Ruff)\n- `flake8-raise (RSE)`: ☑https://github.com/python/typeshed/pull/13751\n- `flake8-return (RET)`: https://github.com/python/typeshed/pull/13323\n- `flake8-self (SLF)`: ❌Already configured to ignore in stubs and covered by [pyright's `reportprivateusage`](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportprivateusage).\n- `flake8-slots (SLOT)`: ☑https://github.com/python/typeshed/pull/13751\n- `flake8-simplify (SIM)`: https://github.com/python/typeshed/pull/13309\n- `flake8-tidy-imports (TID)`: ❌Banned APIs need to be configured to be useful. A mix of stubs use relative imports.\n- `flake8-type-checking (TC)`: https://github.com/python/typeshed/pull/13333\n- `flake8-gettext (INT)`: ❌Not using gettext or translations\n- `flake8-unused-arguments (ARG)`: https://github.com/python/typeshed/pull/13334\n- `flake8-use-pathlib (PTH)`: https://github.com/python/typeshed/pull/13750 & \n- `flake8-todos (TD)`: https://github.com/python/typeshed/pull/13748\n- `flake8-fixme (FIX)`: ❌It doesn't make sense to block the CI on TODOs\n - ⚠There's a feature request to configure rules as warnings in Ruff: https://github.com/astral-sh/ruff/issues/1256\n- `eradicate (ERA)`: ❌Way too many false-positives\n- `pandas-vet (PD)`: ❌Not using Pandas at runtime\n- `pygrep-hooks (PGH)`: https://github.com/python/typeshed/pull/13304\n- `Pylint (PL)`\n - `Pylint Convention (PLC)`: https://github.com/python/typeshed/pull/13306\n - `Pylint Error (PLE)`: https://github.com/python/typeshed/pull/13305\n - `Pylint Refactor (PLR)`: https://github.com/python/typeshed/pull/13307\n - `Pylint Warning (PLW)`: https://github.com/python/typeshed/pull/13749\n- `tryceratops (TRY)`: https://github.com/python/typeshed/pull/13359\n- `flynt (FLY)`: ☑https://github.com/python/typeshed/pull/13751\n- `NumPy-specific rules (NPY)`: ❌We may have to reference or support deprecated numpy types at times\n- `FastAPI (FAST)`: ❌Not using FastAPI at runtime\n- `Airflow (AIR)`: ❌Not using Airflow at runtime\n- `Perflint (PERF)`: https://github.com/python/typeshed/pull/13312\n- `refurb (FURB)`: https://github.com/python/typeshed/pull/13310\n- `pydoclint (DOC)`: ⚠(all in preview, enabling this would do nothing atm)\n- `Ruff-specific rules (RUF)`: https://github.com/python/typeshed/pull/11496\n\n☑: We already pass all these (not yet configured) as-is. Can enable together.\n\u003c/details>","author":{"url":"https://github.com/Avasam","@type":"Person","name":"Avasam"},"datePublished":"2024-12-24T20:39:43Z","url":"https://github.com/python/typeshed/issues/13295"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:15d960ba-0366-5360-3c70-fcb3ef9688b6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CF08:27E6DD:10072A8:14F3B65:6AFFF7B9 |
| html-safe-nonce | 3f46c74951f4928a7da6fa925ccfbada683d1b2e9a185dcde57d7c86a6604f5c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjA4OjI3RTZERDoxMDA3MkE4OjE0RjNCNjU6NkFGRkY3QjkiLCJ2aXNpdG9yX2lkIjoiNjQxMzQyMDA4MDcyNTQ4OTU5MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d838bc11a8a7ef77349b91fa81c6b2f6b9843dcb13058c8aff5d0bee5a7ea833 |
| hovercard-subject-tag | issue:2758273712 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/python/typeshed/13295/issue_layout |
| twitter:image | https://opengraph.githubassets.com/560ac7a61066814e7c8cee5c35cc299eaa413641b55b40080665c87cca6bce6b/python/typeshed/issues/13295 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/560ac7a61066814e7c8cee5c35cc299eaa413641b55b40080665c87cca6bce6b/python/typeshed/issues/13295 |
| og:image:alt | The current selection of Ruff rules comes as a direct translation from when we were using isort, pyupgrade, pycln, Flake8, and some plugins. It made perfect sense at the time to restrict ourselves ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Avasam |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typeshed git https://github.com/python/typeshed.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 31696383 |
| octolytics-dimension-repository_nwo | python/typeshed |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31696383 |
| octolytics-dimension-repository_network_root_nwo | python/typeshed |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width