From 4e516dbe5bd54aa7621c23076cf676875381ee6f Mon Sep 17 00:00:00 2001 From: Sam Cunliffe Date: Wed, 16 Jul 2025 11:13:16 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Add=20FawltyDeps=20as=20a=20=F0=9F=9F=A2=20?= =?UTF-8?q?"best"=20tool.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves #525. Note: it's the best because to my knowledge it's the only tool that does what it does... > It is the single recommended tool for a given purpose. --- docs/pages/linting.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/pages/linting.md b/docs/pages/linting.md index aaddd8a8..1b0b320b 100644 --- a/docs/pages/linting.md +++ b/docs/pages/linting.md @@ -17,6 +17,7 @@ for some of these. | [ruff-format](https://github.com/astral-sh/ruff) | A drop-in replacement for `black` (and also super fast). A nice "no-need to think" code formatter. If you have your own opinions about code style, you might not like this. | Best | | [ruff](https://github.com/astral-sh/ruff) | A fast linter which incorporates a range of other linters. Notably [isort](https://pycqa.github.io/isort/) can be included as a [ruff rule](https://docs.astral.sh/ruff/rules/) (which we recommend). | Best | | [toml-sort](https://github.com/pappasam/toml-sort) | Sorts TOML files which are now part of PEP 8. | Best | +| [fawltydeps](https://tweag.github.io/FawltyDeps/) | Linter which aims to find unused dependencies and undeclared dependencies. | Best | | [autopep8](https://github.com/hhatto/autopep8) | Formatter which conforms to PEP 8. | Good | | [black](https://black.readthedocs.io/en/stable/) | Opinionated formatter, defaults to 88 characters per line. Widely used, but we now recommend `ruff-format` in its place. | Good | | [isort](https://pycqa.github.io/isort/) | Sorts imports alphabetically, splits into first/third party, works on python & cython code. We recommend this, but it can be included in `ruff`, which is simpler. | Good | From 26c1ea03787da61450985b77592e5a85334c4a28 Mon Sep 17 00:00:00 2001 From: Sam Cunliffe Date: Wed, 16 Jul 2025 15:14:10 +0100 Subject: [PATCH 2/2] Add other tools. Seems worth a new table. --- docs/pages/linting.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/pages/linting.md b/docs/pages/linting.md index 1b0b320b..1983cc0a 100644 --- a/docs/pages/linting.md +++ b/docs/pages/linting.md @@ -17,7 +17,6 @@ for some of these. | [ruff-format](https://github.com/astral-sh/ruff) | A drop-in replacement for `black` (and also super fast). A nice "no-need to think" code formatter. If you have your own opinions about code style, you might not like this. | Best | | [ruff](https://github.com/astral-sh/ruff) | A fast linter which incorporates a range of other linters. Notably [isort](https://pycqa.github.io/isort/) can be included as a [ruff rule](https://docs.astral.sh/ruff/rules/) (which we recommend). | Best | | [toml-sort](https://github.com/pappasam/toml-sort) | Sorts TOML files which are now part of PEP 8. | Best | -| [fawltydeps](https://tweag.github.io/FawltyDeps/) | Linter which aims to find unused dependencies and undeclared dependencies. | Best | | [autopep8](https://github.com/hhatto/autopep8) | Formatter which conforms to PEP 8. | Good | | [black](https://black.readthedocs.io/en/stable/) | Opinionated formatter, defaults to 88 characters per line. Widely used, but we now recommend `ruff-format` in its place. | Good | | [isort](https://pycqa.github.io/isort/) | Sorts imports alphabetically, splits into first/third party, works on python & cython code. We recommend this, but it can be included in `ruff`, which is simpler. | Good | @@ -33,3 +32,11 @@ for some of these. | Name | Short description | 🚦 | | ---------------------------------------------- | ----------------------------------------------------------------------------- | :-----------------------------------------: | | [mypy](https://mypy.readthedocs.io/en/stable/) | Static type checker, won't fail if no typing but will if typing is incorrect. | Best | + +### Dependency checking + +| Name | Short description | 🚦 | +| ----------------------------------------------------------------- | ---------------------------------------------------------------- | :------------------------------------------: | +| [deptry](https://deptry.com/) | Checks for unused dependencies and undeclared dependencies. | Good | +| [fawltydeps](https://tweag.github.io/FawltyDeps/) | Checks for unused dependencies and undeclared dependencies. | Good | +| [pip-check-reqs](https://github.com/adamtheturtle/pip-check-reqs) | Checks requirements file (requires converting `pyproject.toml`). | Good |