readability-cli 0.4.0__py3-none-any.whl

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.
@@ -0,0 +1,192 @@
1
+ Metadata-Version: 2.4
2
+ Name: readability-cli
3
+ Version: 0.4.0
4
+ Summary: A CLI to lint, format, and type-check code with Google-style defaults, and pull Google style guides in markdown format.
5
+ Project-URL: Homepage, https://github.com/owahltinez/readability
6
+ Project-URL: Repository, https://github.com/owahltinez/readability
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.12
9
+ Requires-Dist: beautifulsoup4>=4.14.3
10
+ Requires-Dist: click>=8.3.1
11
+ Requires-Dist: markdownify>=1.2.2
12
+ Requires-Dist: requests>=2.33.0
13
+ Description-Content-Type: text/markdown
14
+
15
+ # Readability
16
+
17
+ A CLI tool that keeps code aligned with Google style conventions. It runs the
18
+ right linters, formatters, and type checkers for your project with sensible
19
+ defaults, and serves the official Google style guides in Markdown format. This
20
+ is ideal for AI agents or developers who want consistent code quality checks
21
+ and quick access to style conventions without browsing HTML pages.
22
+
23
+ ## Features
24
+
25
+ - **Linting & Formatting**: A `check` command that automatically detects and
26
+ runs relevant tools (Ruff, Pyrefly, Biome, Prettier, gofmt) for your project.
27
+ - **Sensible Defaults**: Bundled Google-style configurations for Ruff and
28
+ Pyrefly are used automatically when a project does not define its own.
29
+ - **Style Guides**: A `guide` command that fetches the latest Google style
30
+ guides (Python, Shell, C++, Java, JS/TS, Go, etc.) converted to Markdown.
31
+ - **Offline Mode**: Local caching of style guides for fast, offline access,
32
+ kept fresh with a single `sync` command.
33
+
34
+ ## Quick Start
35
+
36
+ You can run the tool directly without installing it using `uvx`:
37
+
38
+ ```bash
39
+ # Check and fix formatting for the current directory
40
+ uvx --from git+https://github.com/owahltinez/readability.git readability check . --fix
41
+
42
+ # Get the Python style guide
43
+ uvx --from git+https://github.com/owahltinez/readability.git readability guide python
44
+ ```
45
+
46
+ ## Installation
47
+
48
+ Install it as a global tool with `uv`:
49
+
50
+ ```bash
51
+ # Install the readability tool
52
+ uv tool install git+https://github.com/owahltinez/readability.git
53
+
54
+ # Use it anywhere
55
+ readability check .
56
+ readability guide python
57
+ ```
58
+
59
+ ### For Development
60
+
61
+ This project uses `uv` for dependency management:
62
+
63
+ ```bash
64
+ # Clone the repository
65
+ git clone https://github.com/owahltinez/readability.git
66
+ cd readability
67
+
68
+ # Install dependencies and create a virtual environment
69
+ uv sync
70
+
71
+ # (Optional) Populate the local cache for offline use
72
+ uv run readability sync
73
+ ```
74
+
75
+ ## Checking and Formatting
76
+
77
+ The `check` command identifies and runs relevant linting and formatting tools
78
+ based on file extensions and the presence of configuration files (triggers) in
79
+ your project root:
80
+
81
+ ```bash
82
+ # Run checks on the current directory
83
+ readability check .
84
+
85
+ # Check specific files or directories
86
+ readability check src/ tests/ main.py
87
+
88
+ # Automatically fix and format files
89
+ readability check . --fix
90
+ ```
91
+
92
+ ### Supported Tools
93
+
94
+ | Tool | Supported Extensions | Trigger Files |
95
+ |------|----------------------|---------------|
96
+ | **Ruff** | `.py` | `pyproject.toml`, `ruff.toml`, `.ruff.toml` |
97
+ | **Pyrefly** | `.py` | `pyproject.toml`, `pyrefly.toml` |
98
+ | **Biome** | `.js`, `.ts`, `.jsx`, `.tsx`, `.json`, `.jsonc`, `.css`, `.html` | `biome.json`, `biome.jsonc` |
99
+ | **Prettier** | `.js`, `.ts`, `.jsx`, `.tsx`, `.json`, `.css`, `.scss`, `.html`, `.md`, `.yml`, `.yaml` | `.prettierrc*`, `prettier.config.*` |
100
+ | **gofmt** | `.go` | `go.mod` |
101
+
102
+ The command will only run a tool if its trigger file exists in the current
103
+ working directory and the tool is available in your `PATH`. For `biome` and
104
+ `prettier`, it attempts to run them via `npx`.
105
+
106
+ ### Default Configurations
107
+
108
+ For Ruff and Pyrefly, bundled defaults based on the
109
+ [Google Python style guide](https://google.github.io/styleguide/pyguide.html)
110
+ (80-column lines, Google docstring convention, import ordering, full type
111
+ checking) are applied when the project does not define its own configuration.
112
+ To override them, add a `[tool.ruff]` or `[tool.pyrefly]` section to your
113
+ `pyproject.toml` (or a dedicated `ruff.toml` / `pyrefly.toml`) — any
114
+ project-level configuration takes full precedence over the bundled defaults.
115
+
116
+ ## Style Guides
117
+
118
+ The `guide` command prints a Google style guide as Markdown, using the local
119
+ cache when available:
120
+
121
+ ```bash
122
+ # Get the Python style guide (uses local cache if available)
123
+ readability guide python
124
+
125
+ # Force fetching the latest version from the web
126
+ readability guide python --remote
127
+
128
+ # Save a style guide to a file
129
+ readability guide cpp --output cpp-style.md
130
+
131
+ # Synchronize all supported style guides to the local cache
132
+ readability sync
133
+ ```
134
+
135
+ ### Supported Languages
136
+
137
+ Use `readability languages` to see a full list of supported languages and
138
+ their aliases. This command also indicates which guides are currently
139
+ available in the local cache with a `[cached]` label:
140
+
141
+ ```bash
142
+ $ readability languages
143
+ Supported languages and their aliases:
144
+ - r [cached]
145
+ - c++, cpp [cached]
146
+ - c#, csharp [cached]
147
+ - docguide, markdown [cached]
148
+ - go [cached]
149
+ - css, html [cached]
150
+ - java [cached]
151
+ - javascript, js [cached]
152
+ - json [cached]
153
+ - objc, objective-c [cached]
154
+ - python [cached]
155
+ - shell [cached]
156
+ - ts, typescript [cached]
157
+ - vim [cached]
158
+ ```
159
+
160
+ ### Offline Mode
161
+
162
+ The tool stores local copies of the style guides in the `guides/` directory
163
+ and the `guide` command uses these local files when they exist. The bundled
164
+ copies are automatically synchronized weekly from the official
165
+ [Google Style Guides](https://google.github.io/styleguide/) repository via
166
+ GitHub Actions, and you can refresh your local cache at any time with the
167
+ `sync` command.
168
+
169
+ You can override the default `guides/` directory by setting the
170
+ `READABILITY_CACHE` environment variable. This is useful if you want to store
171
+ the guides in a specific location or share them across different
172
+ installations:
173
+
174
+ ```bash
175
+ export READABILITY_CACHE=/path/to/my/guides
176
+ readability guide python
177
+ ```
178
+
179
+ ## Development
180
+
181
+ Run tests with `pytest`:
182
+
183
+ ```bash
184
+ uv run pytest
185
+ ```
186
+
187
+ Check code style with `ruff`:
188
+
189
+ ```bash
190
+ uv run ruff check .
191
+ uv run ruff format .
192
+ ```
@@ -0,0 +1,22 @@
1
+ readability.py,sha256=hhVPmknYJC2VqdOCEdFTbHImnb5Yhapo5eGIkn9Sw1o,23725
2
+ configs/pyrefly.toml,sha256=uzJ-ZNtnFd27ho_yjzsaaHJRMW8o1OGT1Vm9xQaPfFE,549
3
+ configs/ruff.toml,sha256=c8TXRMyLgNbX1OIUzhj2WjCwlaA2m4zapTyQYzqzeVY,724
4
+ guides/Rguide.md,sha256=Dpilm781ocQVVpqo8BsKgJ4Q98mI8V_Ph8XUjA5XVHk,2982
5
+ guides/cppguide.md,sha256=6aY-x5wPxJaGgSvJ7_IqnRuTRuTYFpgolwLzsE61CLA,212043
6
+ guides/csharp-style.md,sha256=Gj45PQOhmjzEgLNbJQ2XU1-AiXStjM2aSV1Px1Agfjw,20114
7
+ guides/docguide-style.md,sha256=z27xe0pMckIKYWIaGW6WSADhZsmhMwTIq5iedgSy7pU,25897
8
+ guides/go-guide.md,sha256=8SBRwiBFlTw2iKhfnrqU989htqdpdiZxzb8cpNKzqhs,19740
9
+ guides/htmlcssguide.md,sha256=V4oo7KpmxjVvM7LybPh6bZhAC_4SwuWH8LQmdccl8uY,23741
10
+ guides/javaguide.md,sha256=4W1shlXj5GDPg83jSE6K1l59tzYKyp4feCneYZzKUUE,42340
11
+ guides/jsguide.md,sha256=GchGywHKtYxruG0bsz3sfb8f3K0NAjNikQWwgTO0s7o,120204
12
+ guides/jsoncstyleguide.md,sha256=oe2KBfAamHu3nB5xWLf6Z3zzy8KfUFZEzPW9vbztjIY,36860
13
+ guides/objcguide.md,sha256=1SPaqAJvOxY27GQBetyrPfMCfbdlU2DuwBK-IutL5JU,72787
14
+ guides/pyguide.md,sha256=C9F-rZ5tYLRVAjme9DQaGxuN5FlcC1jpwnLrc_SCfvQ,115828
15
+ guides/shellguide.md,sha256=rw6ZVytl2cZNoANafZ-8PDLYHcconKQTQNEHhyakZL8,40209
16
+ guides/tsguide.md,sha256=jrwcbwAaz3VrSpztyv06EfMSVP5D4wUou84QscrW5WA,106318
17
+ guides/vimscriptguide.md,sha256=asTCEMFryWc1dXN3b8BTix_Y-CX03X4oXkhQXqAa1SU,8156
18
+ readability_cli-0.4.0.dist-info/METADATA,sha256=uOsybXOb6FuGTT9B-moPpvYxHJiHXQtC54qpxQZWPIE,6029
19
+ readability_cli-0.4.0.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
20
+ readability_cli-0.4.0.dist-info/entry_points.txt,sha256=i2flgczUe8ztECWI30D-_oBHmZwqXXkyVGBiSRO1ayI,49
21
+ readability_cli-0.4.0.dist-info/licenses/LICENSE,sha256=LHFhXRfOqppxH3pCE8mWWr3RP_FWivgx5qgh927IFwM,1067
22
+ readability_cli-0.4.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.31.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ readability = readability:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 owahltinez
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.