readability-cli 0.12.0__tar.gz → 0.13.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {readability_cli-0.12.0 → readability_cli-0.13.0}/PKG-INFO +23 -27
- {readability_cli-0.12.0 → readability_cli-0.13.0}/README.md +22 -26
- {readability_cli-0.12.0 → readability_cli-0.13.0}/pyproject.toml +5 -3
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/checking.py +4 -1
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/configs/pyrefly.toml +3 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/configs/ruff.toml +1 -1
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/guides/docguide-style.md +194 -108
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/guides/jsguide.md +1 -1
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/guides/objcguide.md +2 -2
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/guides/pyguide.md +2 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/guides/vimscriptguide.md +1 -1
- readability_cli-0.13.0/readability/project_checkers.py +151 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/tools.py +32 -91
- {readability_cli-0.12.0 → readability_cli-0.13.0}/test_checking.py +68 -4
- {readability_cli-0.12.0 → readability_cli-0.13.0}/test_type_checking.py +58 -2
- {readability_cli-0.12.0 → readability_cli-0.13.0}/uv.lock +21 -21
- {readability_cli-0.12.0 → readability_cli-0.13.0}/.github/workflows/ci.yml +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/.github/workflows/publish.yml +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/.github/workflows/update-guides.yml +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/.gitignore +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/.python-version +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/LICENSE +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/biome.json +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/__init__.py +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/cli.py +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/configs/biome-default.json +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/guide.py +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/guides/Rguide.md +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/guides/cppguide.md +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/guides/csharpguide.md +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/guides/go-guide.md +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/guides/htmlcssguide.md +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/guides/javaguide.md +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/guides/jsoncguide.md +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/guides/shellguide.md +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/guides/tsguide.md +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/readability/outline.py +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/test_guide.py +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/test_outline.py +0 -0
- {readability_cli-0.12.0 → readability_cli-0.13.0}/test_package.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: readability-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.13.0
|
|
4
4
|
Summary: A CLI to lint, format, and type-check code with Google-style defaults, and pull Google style guides in markdown format.
|
|
5
5
|
Project-URL: Homepage, https://github.com/owahltinez/readability
|
|
6
6
|
Project-URL: Repository, https://github.com/owahltinez/readability
|
|
@@ -24,7 +24,7 @@ quick access to style conventions without browsing HTML pages.
|
|
|
24
24
|
|
|
25
25
|
- **Linting & Formatting**: A `check` command that automatically detects and
|
|
26
26
|
runs relevant tools (Ruff, Pyrefly, Biome, tsc, gofmt, goimports, go vet,
|
|
27
|
-
shfmt, shellcheck, and
|
|
27
|
+
shfmt, shellcheck, rustfmt, and clippy) for your project.
|
|
28
28
|
- **Predictable Ownership**: Every supported format has fixed tools, so
|
|
29
29
|
configuration customizes checks without changing which formatter runs.
|
|
30
30
|
- **Style Guides**: A `guide` command that fetches the latest Google style
|
|
@@ -103,23 +103,23 @@ such as gofmt and goimports, are unaffected by it.
|
|
|
103
103
|
|
|
104
104
|
### Supported Formats
|
|
105
105
|
|
|
106
|
-
| Formats
|
|
107
|
-
|
|
|
108
|
-
| `.py`
|
|
109
|
-
| `.js`, `.jsx`, `.ts`, `.tsx`, `.json`, `.jsonc`, `.css`, `.html` | Biome | `biome.json` or `biome.jsonc` |
|
|
110
|
-
| `.ts`, `.tsx`
|
|
111
|
-
| `.go`
|
|
112
|
-
| `.sh`, `.bash`
|
|
113
|
-
| `.rs`
|
|
106
|
+
| Formats | Owners | Project configuration |
|
|
107
|
+
| ----------------------------------------------------------------------- | --------------------------------------- | ------------------------------------- |
|
|
108
|
+
| `.py` | Ruff lint/format; Pyrefly type checking | Ruff and Pyrefly native configuration |
|
|
109
|
+
| `.js`, `.jsx`, `.ts`, `.tsx`, `.json`, `.jsonc`, `.css`, `.html`, `.md` | Biome | `biome.json` or `biome.jsonc` |
|
|
110
|
+
| `.ts`, `.tsx` | tsc type checking | `tsconfig.json`, required |
|
|
111
|
+
| `.go` | gofmt, goimports; go vet | `go.mod`, required by go vet |
|
|
112
|
+
| `.sh`, `.bash` | shfmt format; shellcheck lint | None |
|
|
113
|
+
| `.rs` | rustfmt; clippy lint | `Cargo.toml`, required by clippy |
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
YAML, SCSS, JSONL, and extensions not listed above are unsupported.
|
|
116
116
|
An unsupported-only path reports that nothing was checked and exits
|
|
117
117
|
successfully.
|
|
118
118
|
|
|
119
119
|
Biome first checks a project's `node_modules/.bin`. Ruff, Pyrefly, and Biome
|
|
120
120
|
then use `PATH`, followed by `uvx` for the Python tools or `npx` for Biome. The
|
|
121
|
-
runners cache downloads, so subsequent runs work offline. Gofmt, goimports,
|
|
122
|
-
|
|
121
|
+
runners cache downloads, so subsequent runs work offline. Gofmt, goimports, Go
|
|
122
|
+
itself, for go vet, and Cargo, for clippy, must be available on `PATH`.
|
|
123
123
|
|
|
124
124
|
That keeps this package at ~4 MB rather than the ~54 MB it would take to carry
|
|
125
125
|
Ruff and Pyrefly itself — a cost that would fall on everyone using only `guide`.
|
|
@@ -131,13 +131,7 @@ configurations, and no maximum. A ceiling would freeze anyone who installed
|
|
|
131
131
|
nothing at whatever was current when this package shipped, and tie its releases
|
|
132
132
|
to Ruff's — which has published seventeen minor series, roughly one every six
|
|
133
133
|
weeks. If you need a fixed version, install it: an installed tool always wins
|
|
134
|
-
over a fetched one.
|
|
135
|
-
|
|
136
|
-
Biome is the temporary exception, pinned to 2.5.14: from 2.5.15 it panics
|
|
137
|
-
(`path is expected to be under the root`) when the bundled config sits outside
|
|
138
|
-
the repository being checked, which is every project without its own
|
|
139
|
-
`biome.json` ([biomejs/biome#12158](https://github.com/biomejs/biome/issues/12158)).
|
|
140
|
-
The pin goes once upstream fixes it.
|
|
134
|
+
over a fetched one. Installed Ruff must be 0.16 or later.
|
|
141
135
|
|
|
142
136
|
Set `UV_OFFLINE=1` to forbid fetching. A tool that then cannot be reached fails
|
|
143
137
|
the run rather than passing it.
|
|
@@ -146,12 +140,14 @@ Ruff, Pyrefly, and Biome ship with bundled configurations, so they run on every
|
|
|
146
140
|
file they own without project setup. Gofmt and goimports run on `.go` files even
|
|
147
141
|
when there is no `go.mod`.
|
|
148
142
|
|
|
149
|
-
Tsc
|
|
143
|
+
Tsc, go vet, and clippy have no bundled configuration, since none can check a
|
|
150
144
|
file without its project's imports. They run only inside a `tsconfig.json`
|
|
151
|
-
project
|
|
152
|
-
named files.
|
|
153
|
-
|
|
154
|
-
|
|
145
|
+
project, a Go module, or a Cargo package, and check that whole project or
|
|
146
|
+
package rather than the named files. Clippy denies warnings, so any lint fails
|
|
147
|
+
the check; `--fix` applies its machine-applicable suggestions, even to
|
|
148
|
+
uncommitted files. Tsc comes from the nearest `node_modules/.bin`, searching
|
|
149
|
+
upward as Node does, then `PATH`; it is never fetched, so a project whose
|
|
150
|
+
dependencies are not installed reports it as not installed.
|
|
155
151
|
|
|
156
152
|
A tool that could not be reached at all is never skipped quietly:
|
|
157
153
|
|
|
@@ -218,8 +214,8 @@ For Python, add `[tool.ruff]` or `[tool.pyrefly]` to `pyproject.toml`, or use
|
|
|
218
214
|
their native project configurations in place of bundled defaults. Readability
|
|
219
215
|
does not interpret EditorConfig itself; a canonical tool such as Biome may opt
|
|
220
216
|
into it through that tool's native configuration. Neither gofmt nor goimports
|
|
221
|
-
has project settings. The bundled Biome file requires Biome 2.
|
|
222
|
-
|
|
217
|
+
has project settings. The bundled Biome file requires Biome 2.6.9 or later;
|
|
218
|
+
earlier releases panic on it or cannot format Markdown.
|
|
223
219
|
|
|
224
220
|
Configuration is found per file, in the file's own directory and then its
|
|
225
221
|
ancestors, which is where each canonical tool looks. A package keeping its
|
|
@@ -10,7 +10,7 @@ quick access to style conventions without browsing HTML pages.
|
|
|
10
10
|
|
|
11
11
|
- **Linting & Formatting**: A `check` command that automatically detects and
|
|
12
12
|
runs relevant tools (Ruff, Pyrefly, Biome, tsc, gofmt, goimports, go vet,
|
|
13
|
-
shfmt, shellcheck, and
|
|
13
|
+
shfmt, shellcheck, rustfmt, and clippy) for your project.
|
|
14
14
|
- **Predictable Ownership**: Every supported format has fixed tools, so
|
|
15
15
|
configuration customizes checks without changing which formatter runs.
|
|
16
16
|
- **Style Guides**: A `guide` command that fetches the latest Google style
|
|
@@ -89,23 +89,23 @@ such as gofmt and goimports, are unaffected by it.
|
|
|
89
89
|
|
|
90
90
|
### Supported Formats
|
|
91
91
|
|
|
92
|
-
| Formats
|
|
93
|
-
|
|
|
94
|
-
| `.py`
|
|
95
|
-
| `.js`, `.jsx`, `.ts`, `.tsx`, `.json`, `.jsonc`, `.css`, `.html` | Biome | `biome.json` or `biome.jsonc` |
|
|
96
|
-
| `.ts`, `.tsx`
|
|
97
|
-
| `.go`
|
|
98
|
-
| `.sh`, `.bash`
|
|
99
|
-
| `.rs`
|
|
92
|
+
| Formats | Owners | Project configuration |
|
|
93
|
+
| ----------------------------------------------------------------------- | --------------------------------------- | ------------------------------------- |
|
|
94
|
+
| `.py` | Ruff lint/format; Pyrefly type checking | Ruff and Pyrefly native configuration |
|
|
95
|
+
| `.js`, `.jsx`, `.ts`, `.tsx`, `.json`, `.jsonc`, `.css`, `.html`, `.md` | Biome | `biome.json` or `biome.jsonc` |
|
|
96
|
+
| `.ts`, `.tsx` | tsc type checking | `tsconfig.json`, required |
|
|
97
|
+
| `.go` | gofmt, goimports; go vet | `go.mod`, required by go vet |
|
|
98
|
+
| `.sh`, `.bash` | shfmt format; shellcheck lint | None |
|
|
99
|
+
| `.rs` | rustfmt; clippy lint | `Cargo.toml`, required by clippy |
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
YAML, SCSS, JSONL, and extensions not listed above are unsupported.
|
|
102
102
|
An unsupported-only path reports that nothing was checked and exits
|
|
103
103
|
successfully.
|
|
104
104
|
|
|
105
105
|
Biome first checks a project's `node_modules/.bin`. Ruff, Pyrefly, and Biome
|
|
106
106
|
then use `PATH`, followed by `uvx` for the Python tools or `npx` for Biome. The
|
|
107
|
-
runners cache downloads, so subsequent runs work offline. Gofmt, goimports,
|
|
108
|
-
|
|
107
|
+
runners cache downloads, so subsequent runs work offline. Gofmt, goimports, Go
|
|
108
|
+
itself, for go vet, and Cargo, for clippy, must be available on `PATH`.
|
|
109
109
|
|
|
110
110
|
That keeps this package at ~4 MB rather than the ~54 MB it would take to carry
|
|
111
111
|
Ruff and Pyrefly itself — a cost that would fall on everyone using only `guide`.
|
|
@@ -117,13 +117,7 @@ configurations, and no maximum. A ceiling would freeze anyone who installed
|
|
|
117
117
|
nothing at whatever was current when this package shipped, and tie its releases
|
|
118
118
|
to Ruff's — which has published seventeen minor series, roughly one every six
|
|
119
119
|
weeks. If you need a fixed version, install it: an installed tool always wins
|
|
120
|
-
over a fetched one.
|
|
121
|
-
|
|
122
|
-
Biome is the temporary exception, pinned to 2.5.14: from 2.5.15 it panics
|
|
123
|
-
(`path is expected to be under the root`) when the bundled config sits outside
|
|
124
|
-
the repository being checked, which is every project without its own
|
|
125
|
-
`biome.json` ([biomejs/biome#12158](https://github.com/biomejs/biome/issues/12158)).
|
|
126
|
-
The pin goes once upstream fixes it.
|
|
120
|
+
over a fetched one. Installed Ruff must be 0.16 or later.
|
|
127
121
|
|
|
128
122
|
Set `UV_OFFLINE=1` to forbid fetching. A tool that then cannot be reached fails
|
|
129
123
|
the run rather than passing it.
|
|
@@ -132,12 +126,14 @@ Ruff, Pyrefly, and Biome ship with bundled configurations, so they run on every
|
|
|
132
126
|
file they own without project setup. Gofmt and goimports run on `.go` files even
|
|
133
127
|
when there is no `go.mod`.
|
|
134
128
|
|
|
135
|
-
Tsc
|
|
129
|
+
Tsc, go vet, and clippy have no bundled configuration, since none can check a
|
|
136
130
|
file without its project's imports. They run only inside a `tsconfig.json`
|
|
137
|
-
project
|
|
138
|
-
named files.
|
|
139
|
-
|
|
140
|
-
|
|
131
|
+
project, a Go module, or a Cargo package, and check that whole project or
|
|
132
|
+
package rather than the named files. Clippy denies warnings, so any lint fails
|
|
133
|
+
the check; `--fix` applies its machine-applicable suggestions, even to
|
|
134
|
+
uncommitted files. Tsc comes from the nearest `node_modules/.bin`, searching
|
|
135
|
+
upward as Node does, then `PATH`; it is never fetched, so a project whose
|
|
136
|
+
dependencies are not installed reports it as not installed.
|
|
141
137
|
|
|
142
138
|
A tool that could not be reached at all is never skipped quietly:
|
|
143
139
|
|
|
@@ -204,8 +200,8 @@ For Python, add `[tool.ruff]` or `[tool.pyrefly]` to `pyproject.toml`, or use
|
|
|
204
200
|
their native project configurations in place of bundled defaults. Readability
|
|
205
201
|
does not interpret EditorConfig itself; a canonical tool such as Biome may opt
|
|
206
202
|
into it through that tool's native configuration. Neither gofmt nor goimports
|
|
207
|
-
has project settings. The bundled Biome file requires Biome 2.
|
|
208
|
-
|
|
203
|
+
has project settings. The bundled Biome file requires Biome 2.6.9 or later;
|
|
204
|
+
earlier releases panic on it or cannot format Markdown.
|
|
209
205
|
|
|
210
206
|
Configuration is found per file, in the file's own directory and then its
|
|
211
207
|
ancestors, which is where each canonical tool looks. A package keeping its
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "readability-cli"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.13.0"
|
|
4
4
|
description = "A CLI to lint, format, and type-check code with Google-style defaults, and pull Google style guides in markdown format."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.12"
|
|
@@ -40,15 +40,17 @@ dev = [
|
|
|
40
40
|
"pytest>=9.0.2",
|
|
41
41
|
# The suite and the weekly guide refresh both exercise `sync`.
|
|
42
42
|
"readability-cli[sync]",
|
|
43
|
-
"ruff>=0.
|
|
43
|
+
"ruff>=0.16",
|
|
44
44
|
]
|
|
45
45
|
|
|
46
46
|
[tool.ruff]
|
|
47
47
|
line-length = 80
|
|
48
|
+
# Verbatim copies of the upstream guides
|
|
49
|
+
extend-exclude = ["readability/guides"]
|
|
48
50
|
|
|
49
51
|
[tool.ruff.lint]
|
|
50
52
|
select = ["E", "W", "F", "I", "N", "D", "PL", "B", "UP", "SIM", "C4", "RUF"]
|
|
51
|
-
ignore = ["PLR0911", "PLR0912", "PLR0913", "PLR0915", "PLR2004"]
|
|
53
|
+
ignore = ["PLR0911", "PLR0912", "PLR0913", "PLR0915", "PLR0917", "PLR2004"]
|
|
52
54
|
|
|
53
55
|
[tool.ruff.lint.pydocstyle]
|
|
54
56
|
convention = "google"
|
|
@@ -8,6 +8,7 @@ import subprocess
|
|
|
8
8
|
|
|
9
9
|
import click
|
|
10
10
|
|
|
11
|
+
from readability.project_checkers import _project_checker_plans
|
|
11
12
|
from readability.tools import _command_batches
|
|
12
13
|
from readability.tools import _get_tool_definitions
|
|
13
14
|
from readability.tools import _repository_root
|
|
@@ -137,7 +138,9 @@ def _check_path(
|
|
|
137
138
|
|
|
138
139
|
# Iterate through all supported tool definitions
|
|
139
140
|
report = CheckReport()
|
|
140
|
-
|
|
141
|
+
plans = _get_tool_definitions(path, project_root, boundary)
|
|
142
|
+
plans.extend(_project_checker_plans(path, boundary))
|
|
143
|
+
for tool in plans:
|
|
141
144
|
if not _should_run_tool(tool, path):
|
|
142
145
|
continue
|
|
143
146
|
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
# pyproject.toml). The presence of a config file switches pyrefly from its
|
|
4
4
|
# lenient "basic" preset to full type checking.
|
|
5
5
|
|
|
6
|
+
# pyrefly 1.5+ checks only included files; includes are relative to this file
|
|
7
|
+
project-includes = ["/**/*.py*"]
|
|
8
|
+
|
|
6
9
|
[errors]
|
|
7
10
|
# When this bundled config is used, pyrefly treats its directory as the
|
|
8
11
|
# project root, so imports local to the checked project cannot be resolved
|
|
@@ -10,7 +10,7 @@ line-length = 80
|
|
|
10
10
|
# simplify (SIM), comprehensions (C4), and ruff-specific (RUF) rules
|
|
11
11
|
select = ["E", "W", "F", "I", "N", "D", "PL", "B", "UP", "SIM", "C4", "RUF"]
|
|
12
12
|
# Complexity counters and magic-value warnings are guidance, not errors
|
|
13
|
-
ignore = ["PLR0911", "PLR0912", "PLR0913", "PLR0915", "PLR2004"]
|
|
13
|
+
ignore = ["PLR0911", "PLR0912", "PLR0913", "PLR0915", "PLR0917", "PLR2004"]
|
|
14
14
|
|
|
15
15
|
[lint.pydocstyle]
|
|
16
16
|
convention = "google"
|