readability-cli 0.11.1__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.
Files changed (40) hide show
  1. {readability_cli-0.11.1 → readability_cli-0.13.0}/PKG-INFO +26 -22
  2. {readability_cli-0.11.1 → readability_cli-0.13.0}/README.md +25 -21
  3. {readability_cli-0.11.1 → readability_cli-0.13.0}/pyproject.toml +5 -3
  4. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/checking.py +4 -1
  5. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/configs/pyrefly.toml +3 -0
  6. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/configs/ruff.toml +1 -1
  7. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/guides/docguide-style.md +194 -108
  8. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/guides/jsguide.md +1 -1
  9. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/guides/objcguide.md +2 -2
  10. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/guides/pyguide.md +2 -0
  11. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/guides/vimscriptguide.md +1 -1
  12. readability_cli-0.13.0/readability/project_checkers.py +151 -0
  13. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/tools.py +35 -13
  14. {readability_cli-0.11.1 → readability_cli-0.13.0}/test_checking.py +68 -4
  15. readability_cli-0.13.0/test_type_checking.py +170 -0
  16. {readability_cli-0.11.1 → readability_cli-0.13.0}/uv.lock +21 -21
  17. {readability_cli-0.11.1 → readability_cli-0.13.0}/.github/workflows/ci.yml +0 -0
  18. {readability_cli-0.11.1 → readability_cli-0.13.0}/.github/workflows/publish.yml +0 -0
  19. {readability_cli-0.11.1 → readability_cli-0.13.0}/.github/workflows/update-guides.yml +0 -0
  20. {readability_cli-0.11.1 → readability_cli-0.13.0}/.gitignore +0 -0
  21. {readability_cli-0.11.1 → readability_cli-0.13.0}/.python-version +0 -0
  22. {readability_cli-0.11.1 → readability_cli-0.13.0}/LICENSE +0 -0
  23. {readability_cli-0.11.1 → readability_cli-0.13.0}/biome.json +0 -0
  24. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/__init__.py +0 -0
  25. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/cli.py +0 -0
  26. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/configs/biome-default.json +0 -0
  27. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/guide.py +0 -0
  28. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/guides/Rguide.md +0 -0
  29. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/guides/cppguide.md +0 -0
  30. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/guides/csharpguide.md +0 -0
  31. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/guides/go-guide.md +0 -0
  32. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/guides/htmlcssguide.md +0 -0
  33. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/guides/javaguide.md +0 -0
  34. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/guides/jsoncguide.md +0 -0
  35. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/guides/shellguide.md +0 -0
  36. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/guides/tsguide.md +0 -0
  37. {readability_cli-0.11.1 → readability_cli-0.13.0}/readability/outline.py +0 -0
  38. {readability_cli-0.11.1 → readability_cli-0.13.0}/test_guide.py +0 -0
  39. {readability_cli-0.11.1 → readability_cli-0.13.0}/test_outline.py +0 -0
  40. {readability_cli-0.11.1 → 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.11.1
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
@@ -23,8 +23,8 @@ quick access to style conventions without browsing HTML pages.
23
23
  ## Features
24
24
 
25
25
  - **Linting & Formatting**: A `check` command that automatically detects and
26
- runs relevant tools (Ruff, Pyrefly, Biome, gofmt, goimports, shfmt,
27
- shellcheck, and rustfmt) for your project.
26
+ runs relevant tools (Ruff, Pyrefly, Biome, tsc, gofmt, goimports, go vet,
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,22 +103,23 @@ such as gofmt and goimports, are unaffected by it.
103
103
 
104
104
  ### Supported Formats
105
105
 
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` | Biome | `biome.json` or `biome.jsonc` |
110
- | `.go` | gofmt, goimports | None |
111
- | `.sh`, `.bash` | shfmt format; shellcheck lint | None |
112
- | `.rs` | rustfmt | None |
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 |
113
114
 
114
- Markdown, YAML, SCSS, JSONL, and extensions not listed above are unsupported.
115
+ YAML, SCSS, JSONL, and extensions not listed above are unsupported.
115
116
  An unsupported-only path reports that nothing was checked and exits
116
117
  successfully.
117
118
 
118
119
  Biome first checks a project's `node_modules/.bin`. Ruff, Pyrefly, and Biome
119
120
  then use `PATH`, followed by `uvx` for the Python tools or `npx` for Biome. The
120
- runners cache downloads, so subsequent runs work offline. Gofmt and goimports
121
- must be available on `PATH`.
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`.
122
123
 
123
124
  That keeps this package at ~4 MB rather than the ~54 MB it would take to carry
124
125
  Ruff and Pyrefly itself — a cost that would fall on everyone using only `guide`.
@@ -130,13 +131,7 @@ configurations, and no maximum. A ceiling would freeze anyone who installed
130
131
  nothing at whatever was current when this package shipped, and tie its releases
131
132
  to Ruff's — which has published seventeen minor series, roughly one every six
132
133
  weeks. If you need a fixed version, install it: an installed tool always wins
133
- over a fetched one.
134
-
135
- Biome is the temporary exception, pinned to 2.5.14: from 2.5.15 it panics
136
- (`path is expected to be under the root`) when the bundled config sits outside
137
- the repository being checked, which is every project without its own
138
- `biome.json` ([biomejs/biome#12158](https://github.com/biomejs/biome/issues/12158)).
139
- The pin goes once upstream fixes it.
134
+ over a fetched one. Installed Ruff must be 0.16 or later.
140
135
 
141
136
  Set `UV_OFFLINE=1` to forbid fetching. A tool that then cannot be reached fails
142
137
  the run rather than passing it.
@@ -145,6 +140,15 @@ Ruff, Pyrefly, and Biome ship with bundled configurations, so they run on every
145
140
  file they own without project setup. Gofmt and goimports run on `.go` files even
146
141
  when there is no `go.mod`.
147
142
 
143
+ Tsc, go vet, and clippy have no bundled configuration, since none can check a
144
+ file without its project's imports. They run only inside a `tsconfig.json`
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.
151
+
148
152
  A tool that could not be reached at all is never skipped quietly:
149
153
 
150
154
  ```bash
@@ -210,8 +214,8 @@ For Python, add `[tool.ruff]` or `[tool.pyrefly]` to `pyproject.toml`, or use
210
214
  their native project configurations in place of bundled defaults. Readability
211
215
  does not interpret EditorConfig itself; a canonical tool such as Biome may opt
212
216
  into it through that tool's native configuration. Neither gofmt nor goimports
213
- has project settings. The bundled Biome file requires Biome 2.5 or later; the
214
- fallback runner is pinned to 2.5.14 for now.
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.
215
219
 
216
220
  Configuration is found per file, in the file's own directory and then its
217
221
  ancestors, which is where each canonical tool looks. A package keeping its
@@ -9,8 +9,8 @@ quick access to style conventions without browsing HTML pages.
9
9
  ## Features
10
10
 
11
11
  - **Linting & Formatting**: A `check` command that automatically detects and
12
- runs relevant tools (Ruff, Pyrefly, Biome, gofmt, goimports, shfmt,
13
- shellcheck, and rustfmt) for your project.
12
+ runs relevant tools (Ruff, Pyrefly, Biome, tsc, gofmt, goimports, go vet,
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,22 +89,23 @@ such as gofmt and goimports, are unaffected by it.
89
89
 
90
90
  ### Supported Formats
91
91
 
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` | Biome | `biome.json` or `biome.jsonc` |
96
- | `.go` | gofmt, goimports | None |
97
- | `.sh`, `.bash` | shfmt format; shellcheck lint | None |
98
- | `.rs` | rustfmt | None |
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 |
99
100
 
100
- Markdown, YAML, SCSS, JSONL, and extensions not listed above are unsupported.
101
+ YAML, SCSS, JSONL, and extensions not listed above are unsupported.
101
102
  An unsupported-only path reports that nothing was checked and exits
102
103
  successfully.
103
104
 
104
105
  Biome first checks a project's `node_modules/.bin`. Ruff, Pyrefly, and Biome
105
106
  then use `PATH`, followed by `uvx` for the Python tools or `npx` for Biome. The
106
- runners cache downloads, so subsequent runs work offline. Gofmt and goimports
107
- must be available on `PATH`.
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`.
108
109
 
109
110
  That keeps this package at ~4 MB rather than the ~54 MB it would take to carry
110
111
  Ruff and Pyrefly itself — a cost that would fall on everyone using only `guide`.
@@ -116,13 +117,7 @@ configurations, and no maximum. A ceiling would freeze anyone who installed
116
117
  nothing at whatever was current when this package shipped, and tie its releases
117
118
  to Ruff's — which has published seventeen minor series, roughly one every six
118
119
  weeks. If you need a fixed version, install it: an installed tool always wins
119
- over a fetched one.
120
-
121
- Biome is the temporary exception, pinned to 2.5.14: from 2.5.15 it panics
122
- (`path is expected to be under the root`) when the bundled config sits outside
123
- the repository being checked, which is every project without its own
124
- `biome.json` ([biomejs/biome#12158](https://github.com/biomejs/biome/issues/12158)).
125
- The pin goes once upstream fixes it.
120
+ over a fetched one. Installed Ruff must be 0.16 or later.
126
121
 
127
122
  Set `UV_OFFLINE=1` to forbid fetching. A tool that then cannot be reached fails
128
123
  the run rather than passing it.
@@ -131,6 +126,15 @@ Ruff, Pyrefly, and Biome ship with bundled configurations, so they run on every
131
126
  file they own without project setup. Gofmt and goimports run on `.go` files even
132
127
  when there is no `go.mod`.
133
128
 
129
+ Tsc, go vet, and clippy have no bundled configuration, since none can check a
130
+ file without its project's imports. They run only inside a `tsconfig.json`
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.
137
+
134
138
  A tool that could not be reached at all is never skipped quietly:
135
139
 
136
140
  ```bash
@@ -196,8 +200,8 @@ For Python, add `[tool.ruff]` or `[tool.pyrefly]` to `pyproject.toml`, or use
196
200
  their native project configurations in place of bundled defaults. Readability
197
201
  does not interpret EditorConfig itself; a canonical tool such as Biome may opt
198
202
  into it through that tool's native configuration. Neither gofmt nor goimports
199
- has project settings. The bundled Biome file requires Biome 2.5 or later; the
200
- fallback runner is pinned to 2.5.14 for now.
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.
201
205
 
202
206
  Configuration is found per file, in the file's own directory and then its
203
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.11.1"
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.15.8",
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
- for tool in _get_tool_definitions(path, project_root, boundary):
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"