code-normalizer-pro 3.0.1__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.
- code_normalizer_pro-3.0.1/LICENSE +22 -0
- code_normalizer_pro-3.0.1/PKG-INFO +304 -0
- code_normalizer_pro-3.0.1/README.md +277 -0
- code_normalizer_pro-3.0.1/code_normalizer_pro/__init__.py +5 -0
- code_normalizer_pro-3.0.1/code_normalizer_pro/cli.py +42 -0
- code_normalizer_pro-3.0.1/code_normalizer_pro/code_normalize_pro.py +989 -0
- code_normalizer_pro-3.0.1/code_normalizer_pro.egg-info/PKG-INFO +304 -0
- code_normalizer_pro-3.0.1/code_normalizer_pro.egg-info/SOURCES.txt +18 -0
- code_normalizer_pro-3.0.1/code_normalizer_pro.egg-info/dependency_links.txt +1 -0
- code_normalizer_pro-3.0.1/code_normalizer_pro.egg-info/entry_points.txt +2 -0
- code_normalizer_pro-3.0.1/code_normalizer_pro.egg-info/requires.txt +4 -0
- code_normalizer_pro-3.0.1/code_normalizer_pro.egg-info/top_level.txt +1 -0
- code_normalizer_pro-3.0.1/main.py +16 -0
- code_normalizer_pro-3.0.1/pyproject.toml +48 -0
- code_normalizer_pro-3.0.1/setup.cfg +4 -0
- code_normalizer_pro-3.0.1/tests/test_code_normalize_pro.py +118 -0
- code_normalizer_pro-3.0.1/tests/test_feedback_prioritizer.py +49 -0
- code_normalizer_pro-3.0.1/tests/test_launch_metrics.py +42 -0
- code_normalizer_pro-3.0.1/tests/test_release_prep.py +41 -0
- code_normalizer_pro-3.0.1/tests/test_sales_pipeline_metrics.py +40 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026
|
|
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.
|
|
22
|
+
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: code-normalizer-pro
|
|
3
|
+
Version: 3.0.1
|
|
4
|
+
Summary: Production-grade code normalization tool for encoding, newlines, and whitespace hygiene.
|
|
5
|
+
Author: MR
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/MRJR0101/code-normalizer-pro
|
|
8
|
+
Project-URL: Documentation, https://github.com/MRJR0101/code-normalizer-pro/blob/main/README.md
|
|
9
|
+
Project-URL: Issues, https://github.com/MRJR0101/code-normalizer-pro/issues
|
|
10
|
+
Keywords: code-quality,formatter,normalization,cli,python
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
19
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: tqdm
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pytest>=7; extra == "dev"
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
# CODE - Code Normalization Tool
|
|
29
|
+
|
|
30
|
+
**Python CLI that cleans up source code encoding, line endings, and whitespace
|
|
31
|
+
across entire codebases -- with parallel processing, SHA256 caching, and pre-commit hook support.**
|
|
32
|
+
|
|
33
|
+
- Location: `C:\Dev\PROJECTS\CODE`
|
|
34
|
+
- Status: v3.0 code complete. Package stub ready. No pyproject.toml = blocked from PyPI.
|
|
35
|
+
- Updated: 2026-03-10
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## What It Does
|
|
40
|
+
|
|
41
|
+
Run it against any directory and it will:
|
|
42
|
+
|
|
43
|
+
1. Detect and convert file encoding to UTF-8
|
|
44
|
+
(handles utf-8, utf-8-sig, utf-16, utf-16-le, utf-16-be, windows-1252, latin-1, iso-8859-1)
|
|
45
|
+
2. Fix line endings -- CRLF to LF
|
|
46
|
+
3. Strip trailing whitespace from every line
|
|
47
|
+
4. Ensure a single newline at end of file
|
|
48
|
+
5. Optionally validate syntax for Python, JS, TS, Go, Rust, C, C++, Java
|
|
49
|
+
|
|
50
|
+
Files already clean are skipped. SHA256 caching means repeat runs on unchanged files
|
|
51
|
+
are near-instant. Multi-core parallel mode handles large codebases at 80-200 files/sec.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Quick Start
|
|
56
|
+
|
|
57
|
+
```powershell
|
|
58
|
+
Set-Location C:\Dev\PROJECTS\CODE
|
|
59
|
+
|
|
60
|
+
# See what would change without touching anything
|
|
61
|
+
python main.py C:\path\to\project --dry-run
|
|
62
|
+
|
|
63
|
+
# Normalize everything in-place using all CPU cores
|
|
64
|
+
python main.py C:\path\to\project --parallel --in-place
|
|
65
|
+
|
|
66
|
+
# Normalize only Python and JavaScript files
|
|
67
|
+
python main.py C:\path\to\project -e .py -e .js --in-place
|
|
68
|
+
|
|
69
|
+
# Review and approve each file before it's written
|
|
70
|
+
python main.py C:\path\to\project --interactive
|
|
71
|
+
|
|
72
|
+
# Run syntax validation after normalizing
|
|
73
|
+
python main.py C:\path\to\project --in-place --check
|
|
74
|
+
|
|
75
|
+
# Install a pre-commit hook into a git repo
|
|
76
|
+
cd C:\your-repo
|
|
77
|
+
python C:\Dev\PROJECTS\CODE\main.py --install-hook
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`main.py` at root is a thin wrapper that delegates to `src/code_normalize_pro.py`.
|
|
81
|
+
Call either one -- same result.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Pre-Commit Hook
|
|
86
|
+
|
|
87
|
+
Checks only staged files before each commit. Blocks commit if any need normalization
|
|
88
|
+
and prints the fix command.
|
|
89
|
+
|
|
90
|
+
```powershell
|
|
91
|
+
# One-time install per repo
|
|
92
|
+
cd C:\your-repo
|
|
93
|
+
python C:\Dev\PROJECTS\CODE\main.py --install-hook
|
|
94
|
+
|
|
95
|
+
# Commit as normal -- hook fires automatically
|
|
96
|
+
git commit -m "your message"
|
|
97
|
+
|
|
98
|
+
# Skip hook for one commit
|
|
99
|
+
git commit --no-verify -m "your message"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Performance
|
|
105
|
+
|
|
106
|
+
| Files | Sequential | Parallel 4-core | Speedup |
|
|
107
|
+
|-------|------------|-----------------|---------|
|
|
108
|
+
| 100 | 3.2s | 1.1s | 2.9x |
|
|
109
|
+
| 500 | 16.8s | 4.3s | 3.9x |
|
|
110
|
+
| 1000 | 33.5s | 7.1s | 4.7x |
|
|
111
|
+
|
|
112
|
+
8 cores: 150-200 files/sec. SHA256 cache on unchanged files: 500-1000 files/sec.
|
|
113
|
+
Workers default to CPU count. Override with `--workers N`.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Testing
|
|
118
|
+
|
|
119
|
+
```powershell
|
|
120
|
+
Set-Location C:\Dev\PROJECTS\CODE
|
|
121
|
+
.\.venv\Scripts\Activate.ps1
|
|
122
|
+
|
|
123
|
+
python -m pytest -q
|
|
124
|
+
python main.py --help
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Test files in `tests/` cover the main tool plus all four launch/sales scripts.
|
|
128
|
+
All 5 features tested on 2026-02-09 (see docs/TEST_REPORT.md). Manual confirmation
|
|
129
|
+
of interactive mode still pending.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Project Layout
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
CODE/
|
|
137
|
+
main.py -- Root entrypoint. Delegates to src/code_normalize_pro.py
|
|
138
|
+
src/
|
|
139
|
+
code_normalize_pro.py -- v3.0 Pro. 917 lines. The active tool.
|
|
140
|
+
code_normalize_v2.py -- v2.0. Kept for reference.
|
|
141
|
+
code_normalizer_pro/ -- PyPI package stub
|
|
142
|
+
__init__.py -- Exposes __version__ = "3.0.1"
|
|
143
|
+
cli.py -- Console entry point (calls src/code_normalize_pro.py)
|
|
144
|
+
README.md
|
|
145
|
+
config/
|
|
146
|
+
settings.py -- Env-var settings loader (not wired up yet)
|
|
147
|
+
docs/
|
|
148
|
+
README.md -- Full feature reference docs
|
|
149
|
+
TEST_REPORT.md -- Test results from 2026-02-09
|
|
150
|
+
ARCHITECTURE.md -- Stub
|
|
151
|
+
launch/ -- Outreach templates, user tracking CSV, metrics JSON
|
|
152
|
+
sales/ -- Pricing, pipeline CSV, customer offer template
|
|
153
|
+
release/
|
|
154
|
+
alpha_release_checklist.md -- Step-by-step PyPI publish checklist
|
|
155
|
+
release_readiness.json -- Says ready=true, wheel+sdist listed
|
|
156
|
+
roadmaps/
|
|
157
|
+
README.md -- Overview of all 6 paths
|
|
158
|
+
01_solo_dev_tool.md -- CHOSEN: bootstrap to PyPI
|
|
159
|
+
02_dev_tool_saas.md
|
|
160
|
+
03_enterprise_platform.md
|
|
161
|
+
04_open_source_support.md
|
|
162
|
+
05_grammarly_for_code.md
|
|
163
|
+
06_ai_transformation_engine.md
|
|
164
|
+
scripts/
|
|
165
|
+
launch_metrics.py
|
|
166
|
+
feedback_prioritizer.py
|
|
167
|
+
sales_pipeline_metrics.py
|
|
168
|
+
release_prep.py
|
|
169
|
+
tests/
|
|
170
|
+
test_code_normalize_pro.py
|
|
171
|
+
test_feedback_prioritizer.py
|
|
172
|
+
test_launch_metrics.py
|
|
173
|
+
test_release_prep.py
|
|
174
|
+
test_sales_pipeline_metrics.py
|
|
175
|
+
site/
|
|
176
|
+
index.html -- Static landing page
|
|
177
|
+
styles.css
|
|
178
|
+
.github/
|
|
179
|
+
workflows/ci.yml -- CI: install, smoke check, pytest, build
|
|
180
|
+
ISSUE_TEMPLATE/
|
|
181
|
+
pull_request_template.md
|
|
182
|
+
files/
|
|
183
|
+
cache_sandbox/ -- Test fixtures (a.py, b.py)
|
|
184
|
+
smoke_case.py
|
|
185
|
+
EXECUTION_PLAN.md -- 7-day launch plan (all tasks pending)
|
|
186
|
+
VERIFY.md -- Verification runbook
|
|
187
|
+
MISSINGMORE.txt -- Gap tracking
|
|
188
|
+
QUICK_REFERENCE.md -- Command cheat sheet
|
|
189
|
+
CHANGELOG.md -- Stub (unreleased only)
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Dependencies
|
|
195
|
+
|
|
196
|
+
Core: zero. Python 3.10+ only.
|
|
197
|
+
|
|
198
|
+
Optional:
|
|
199
|
+
- `tqdm` -- progress bars
|
|
200
|
+
- Syntax checkers (only needed with `--check`):
|
|
201
|
+
Python: built-in (py_compile) | JS: node | TS: tsc | Go: gofmt
|
|
202
|
+
Rust: rustc | C: gcc | C++: g++ | Java: javac
|
|
203
|
+
|
|
204
|
+
Dev/test: pytest (see requirements.txt)
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Known Issues (fix before PyPI launch)
|
|
209
|
+
|
|
210
|
+
**Critical -- blocks shipping:**
|
|
211
|
+
|
|
212
|
+
1. No `pyproject.toml` -- CI runs `python -m build` which will fail without it.
|
|
213
|
+
The `code_normalizer_pro.egg-info/` dir shows packaging was attempted but no
|
|
214
|
+
config file exists in the tree. Create `pyproject.toml` with src layout and
|
|
215
|
+
console_scripts entry point before running Day 1 tasks.
|
|
216
|
+
|
|
217
|
+
2. `code_normalizer_pro/cli.py` has a broken import:
|
|
218
|
+
`from code_normalize_pro import main`
|
|
219
|
+
After `pip install`, Python looks for a module named `code_normalize_pro` in
|
|
220
|
+
site-packages, not in `src/`. Without a proper src layout in pyproject.toml,
|
|
221
|
+
the installed CLI command will fail on launch.
|
|
222
|
+
|
|
223
|
+
**Code bugs worth fixing:**
|
|
224
|
+
|
|
225
|
+
3. Cache default is on in `__init__` but `--cache` flag implies opt-in and
|
|
226
|
+
`--no-cache` implies opt-out. The flags and the default contradict each other.
|
|
227
|
+
Pick one direction and make the help text match.
|
|
228
|
+
|
|
229
|
+
4. `--parallel --in-place` silently disables backups. `process_file_worker`
|
|
230
|
+
passes `create_backup=False` but backup logic only lives inside `process_file`.
|
|
231
|
+
Users running parallel mode have no backups. Either warn loudly or fix it.
|
|
232
|
+
|
|
233
|
+
5. `walk_and_process` and `process_file` both increment `total_files` for the
|
|
234
|
+
same files. Summary stats will show inflated counts.
|
|
235
|
+
|
|
236
|
+
6. `.normalize-cache.json` lands in CWD, not the target directory. Running the
|
|
237
|
+
tool against three different projects from the same shell session corrupts the
|
|
238
|
+
cache. Pass `root / CACHE_FILE` to CacheManager in `walk_and_process`.
|
|
239
|
+
|
|
240
|
+
7. `--dry-run` always exits 0 even when it finds files needing normalization.
|
|
241
|
+
CI pipelines need a non-zero exit to catch violations. Add `--fail-on-changes`
|
|
242
|
+
or make dry-run exit 1 when changes are detected.
|
|
243
|
+
|
|
244
|
+
**Cleanup:**
|
|
245
|
+
|
|
246
|
+
8. `code_normalize_pro.py` at root -- stale copy. Real file is `src/`. Delete it.
|
|
247
|
+
9. `roadmaps/New Text Document.txt` -- empty temp file. Delete it.
|
|
248
|
+
10. `roadmaps/talking about code.txt` -- saved AI chat session. Delete or move to docs/.
|
|
249
|
+
11. All `README_20260220_*.md.bak` files throughout the tree -- ReadmeForge backups.
|
|
250
|
+
12. `config/settings.py` is a clean env-var loader but nothing imports it.
|
|
251
|
+
Either wire it into `code_normalize_pro.py` or remove it.
|
|
252
|
+
13. `README_PRO.md` at root duplicates `docs/README.md`. Consolidate.
|
|
253
|
+
14. `restore_report.json` and `smoke_report.json` at root -- generated artifacts,
|
|
254
|
+
add to `.gitignore`.
|
|
255
|
+
15. `PROJECT_STATUS.md` says roadmap docs are "coming soon" -- all 6 exist. Stale.
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Launch Status (Path 1 - Solo Dev Tool)
|
|
260
|
+
|
|
261
|
+
EXECUTION_PLAN.md has a 7-day checklist. As of 2026-03-10, nothing started.
|
|
262
|
+
|
|
263
|
+
Before Day 1 tasks will work, pyproject.toml needs to exist (see issue #1 above).
|
|
264
|
+
|
|
265
|
+
Day 1 after pyproject.toml is in place:
|
|
266
|
+
|
|
267
|
+
```powershell
|
|
268
|
+
Set-Location C:\Dev\PROJECTS\CODE
|
|
269
|
+
.\.venv\Scripts\Activate.ps1
|
|
270
|
+
python -m pytest -q
|
|
271
|
+
pip install -e .
|
|
272
|
+
code-normalizer-pro --help
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Full release steps: see `docs/release/alpha_release_checklist.md`
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## CI
|
|
280
|
+
|
|
281
|
+
`.github/workflows/ci.yml` runs on push to main/master and on PRs:
|
|
282
|
+
- Python 3.11
|
|
283
|
+
- pip install from requirements.txt
|
|
284
|
+
- CLI smoke check (main.py and src/code_normalize_pro.py --help)
|
|
285
|
+
- pytest -q
|
|
286
|
+
- python -m build (sdist + wheel)
|
|
287
|
+
|
|
288
|
+
Note: `python -m build` requires `pyproject.toml`. CI will fail until that exists.
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## Version History
|
|
293
|
+
|
|
294
|
+
| Version | Date | Changes |
|
|
295
|
+
|---------|------------|---------|
|
|
296
|
+
| v3.0 | 2026-02-09 | Parallel processing, SHA256 caching, pre-commit hooks, multi-language syntax, interactive mode |
|
|
297
|
+
| v2.0 | 2026-02-09 | Dry-run, in-place editing, backups, tqdm, detailed stats |
|
|
298
|
+
| v1.0 | -- | Basic encoding fix, CRLF, whitespace |
|
|
299
|
+
|
|
300
|
+
Package version: 3.0.1 (set in `code_normalizer_pro/__init__.py`)
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
Developer: MR (Michael Rawls Jr.) -- Houston, TX -- GitHub: MRJR0101
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
# CODE - Code Normalization Tool
|
|
2
|
+
|
|
3
|
+
**Python CLI that cleans up source code encoding, line endings, and whitespace
|
|
4
|
+
across entire codebases -- with parallel processing, SHA256 caching, and pre-commit hook support.**
|
|
5
|
+
|
|
6
|
+
- Location: `C:\Dev\PROJECTS\CODE`
|
|
7
|
+
- Status: v3.0 code complete. Package stub ready. No pyproject.toml = blocked from PyPI.
|
|
8
|
+
- Updated: 2026-03-10
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## What It Does
|
|
13
|
+
|
|
14
|
+
Run it against any directory and it will:
|
|
15
|
+
|
|
16
|
+
1. Detect and convert file encoding to UTF-8
|
|
17
|
+
(handles utf-8, utf-8-sig, utf-16, utf-16-le, utf-16-be, windows-1252, latin-1, iso-8859-1)
|
|
18
|
+
2. Fix line endings -- CRLF to LF
|
|
19
|
+
3. Strip trailing whitespace from every line
|
|
20
|
+
4. Ensure a single newline at end of file
|
|
21
|
+
5. Optionally validate syntax for Python, JS, TS, Go, Rust, C, C++, Java
|
|
22
|
+
|
|
23
|
+
Files already clean are skipped. SHA256 caching means repeat runs on unchanged files
|
|
24
|
+
are near-instant. Multi-core parallel mode handles large codebases at 80-200 files/sec.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
```powershell
|
|
31
|
+
Set-Location C:\Dev\PROJECTS\CODE
|
|
32
|
+
|
|
33
|
+
# See what would change without touching anything
|
|
34
|
+
python main.py C:\path\to\project --dry-run
|
|
35
|
+
|
|
36
|
+
# Normalize everything in-place using all CPU cores
|
|
37
|
+
python main.py C:\path\to\project --parallel --in-place
|
|
38
|
+
|
|
39
|
+
# Normalize only Python and JavaScript files
|
|
40
|
+
python main.py C:\path\to\project -e .py -e .js --in-place
|
|
41
|
+
|
|
42
|
+
# Review and approve each file before it's written
|
|
43
|
+
python main.py C:\path\to\project --interactive
|
|
44
|
+
|
|
45
|
+
# Run syntax validation after normalizing
|
|
46
|
+
python main.py C:\path\to\project --in-place --check
|
|
47
|
+
|
|
48
|
+
# Install a pre-commit hook into a git repo
|
|
49
|
+
cd C:\your-repo
|
|
50
|
+
python C:\Dev\PROJECTS\CODE\main.py --install-hook
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`main.py` at root is a thin wrapper that delegates to `src/code_normalize_pro.py`.
|
|
54
|
+
Call either one -- same result.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Pre-Commit Hook
|
|
59
|
+
|
|
60
|
+
Checks only staged files before each commit. Blocks commit if any need normalization
|
|
61
|
+
and prints the fix command.
|
|
62
|
+
|
|
63
|
+
```powershell
|
|
64
|
+
# One-time install per repo
|
|
65
|
+
cd C:\your-repo
|
|
66
|
+
python C:\Dev\PROJECTS\CODE\main.py --install-hook
|
|
67
|
+
|
|
68
|
+
# Commit as normal -- hook fires automatically
|
|
69
|
+
git commit -m "your message"
|
|
70
|
+
|
|
71
|
+
# Skip hook for one commit
|
|
72
|
+
git commit --no-verify -m "your message"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Performance
|
|
78
|
+
|
|
79
|
+
| Files | Sequential | Parallel 4-core | Speedup |
|
|
80
|
+
|-------|------------|-----------------|---------|
|
|
81
|
+
| 100 | 3.2s | 1.1s | 2.9x |
|
|
82
|
+
| 500 | 16.8s | 4.3s | 3.9x |
|
|
83
|
+
| 1000 | 33.5s | 7.1s | 4.7x |
|
|
84
|
+
|
|
85
|
+
8 cores: 150-200 files/sec. SHA256 cache on unchanged files: 500-1000 files/sec.
|
|
86
|
+
Workers default to CPU count. Override with `--workers N`.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Testing
|
|
91
|
+
|
|
92
|
+
```powershell
|
|
93
|
+
Set-Location C:\Dev\PROJECTS\CODE
|
|
94
|
+
.\.venv\Scripts\Activate.ps1
|
|
95
|
+
|
|
96
|
+
python -m pytest -q
|
|
97
|
+
python main.py --help
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Test files in `tests/` cover the main tool plus all four launch/sales scripts.
|
|
101
|
+
All 5 features tested on 2026-02-09 (see docs/TEST_REPORT.md). Manual confirmation
|
|
102
|
+
of interactive mode still pending.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Project Layout
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
CODE/
|
|
110
|
+
main.py -- Root entrypoint. Delegates to src/code_normalize_pro.py
|
|
111
|
+
src/
|
|
112
|
+
code_normalize_pro.py -- v3.0 Pro. 917 lines. The active tool.
|
|
113
|
+
code_normalize_v2.py -- v2.0. Kept for reference.
|
|
114
|
+
code_normalizer_pro/ -- PyPI package stub
|
|
115
|
+
__init__.py -- Exposes __version__ = "3.0.1"
|
|
116
|
+
cli.py -- Console entry point (calls src/code_normalize_pro.py)
|
|
117
|
+
README.md
|
|
118
|
+
config/
|
|
119
|
+
settings.py -- Env-var settings loader (not wired up yet)
|
|
120
|
+
docs/
|
|
121
|
+
README.md -- Full feature reference docs
|
|
122
|
+
TEST_REPORT.md -- Test results from 2026-02-09
|
|
123
|
+
ARCHITECTURE.md -- Stub
|
|
124
|
+
launch/ -- Outreach templates, user tracking CSV, metrics JSON
|
|
125
|
+
sales/ -- Pricing, pipeline CSV, customer offer template
|
|
126
|
+
release/
|
|
127
|
+
alpha_release_checklist.md -- Step-by-step PyPI publish checklist
|
|
128
|
+
release_readiness.json -- Says ready=true, wheel+sdist listed
|
|
129
|
+
roadmaps/
|
|
130
|
+
README.md -- Overview of all 6 paths
|
|
131
|
+
01_solo_dev_tool.md -- CHOSEN: bootstrap to PyPI
|
|
132
|
+
02_dev_tool_saas.md
|
|
133
|
+
03_enterprise_platform.md
|
|
134
|
+
04_open_source_support.md
|
|
135
|
+
05_grammarly_for_code.md
|
|
136
|
+
06_ai_transformation_engine.md
|
|
137
|
+
scripts/
|
|
138
|
+
launch_metrics.py
|
|
139
|
+
feedback_prioritizer.py
|
|
140
|
+
sales_pipeline_metrics.py
|
|
141
|
+
release_prep.py
|
|
142
|
+
tests/
|
|
143
|
+
test_code_normalize_pro.py
|
|
144
|
+
test_feedback_prioritizer.py
|
|
145
|
+
test_launch_metrics.py
|
|
146
|
+
test_release_prep.py
|
|
147
|
+
test_sales_pipeline_metrics.py
|
|
148
|
+
site/
|
|
149
|
+
index.html -- Static landing page
|
|
150
|
+
styles.css
|
|
151
|
+
.github/
|
|
152
|
+
workflows/ci.yml -- CI: install, smoke check, pytest, build
|
|
153
|
+
ISSUE_TEMPLATE/
|
|
154
|
+
pull_request_template.md
|
|
155
|
+
files/
|
|
156
|
+
cache_sandbox/ -- Test fixtures (a.py, b.py)
|
|
157
|
+
smoke_case.py
|
|
158
|
+
EXECUTION_PLAN.md -- 7-day launch plan (all tasks pending)
|
|
159
|
+
VERIFY.md -- Verification runbook
|
|
160
|
+
MISSINGMORE.txt -- Gap tracking
|
|
161
|
+
QUICK_REFERENCE.md -- Command cheat sheet
|
|
162
|
+
CHANGELOG.md -- Stub (unreleased only)
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Dependencies
|
|
168
|
+
|
|
169
|
+
Core: zero. Python 3.10+ only.
|
|
170
|
+
|
|
171
|
+
Optional:
|
|
172
|
+
- `tqdm` -- progress bars
|
|
173
|
+
- Syntax checkers (only needed with `--check`):
|
|
174
|
+
Python: built-in (py_compile) | JS: node | TS: tsc | Go: gofmt
|
|
175
|
+
Rust: rustc | C: gcc | C++: g++ | Java: javac
|
|
176
|
+
|
|
177
|
+
Dev/test: pytest (see requirements.txt)
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Known Issues (fix before PyPI launch)
|
|
182
|
+
|
|
183
|
+
**Critical -- blocks shipping:**
|
|
184
|
+
|
|
185
|
+
1. No `pyproject.toml` -- CI runs `python -m build` which will fail without it.
|
|
186
|
+
The `code_normalizer_pro.egg-info/` dir shows packaging was attempted but no
|
|
187
|
+
config file exists in the tree. Create `pyproject.toml` with src layout and
|
|
188
|
+
console_scripts entry point before running Day 1 tasks.
|
|
189
|
+
|
|
190
|
+
2. `code_normalizer_pro/cli.py` has a broken import:
|
|
191
|
+
`from code_normalize_pro import main`
|
|
192
|
+
After `pip install`, Python looks for a module named `code_normalize_pro` in
|
|
193
|
+
site-packages, not in `src/`. Without a proper src layout in pyproject.toml,
|
|
194
|
+
the installed CLI command will fail on launch.
|
|
195
|
+
|
|
196
|
+
**Code bugs worth fixing:**
|
|
197
|
+
|
|
198
|
+
3. Cache default is on in `__init__` but `--cache` flag implies opt-in and
|
|
199
|
+
`--no-cache` implies opt-out. The flags and the default contradict each other.
|
|
200
|
+
Pick one direction and make the help text match.
|
|
201
|
+
|
|
202
|
+
4. `--parallel --in-place` silently disables backups. `process_file_worker`
|
|
203
|
+
passes `create_backup=False` but backup logic only lives inside `process_file`.
|
|
204
|
+
Users running parallel mode have no backups. Either warn loudly or fix it.
|
|
205
|
+
|
|
206
|
+
5. `walk_and_process` and `process_file` both increment `total_files` for the
|
|
207
|
+
same files. Summary stats will show inflated counts.
|
|
208
|
+
|
|
209
|
+
6. `.normalize-cache.json` lands in CWD, not the target directory. Running the
|
|
210
|
+
tool against three different projects from the same shell session corrupts the
|
|
211
|
+
cache. Pass `root / CACHE_FILE` to CacheManager in `walk_and_process`.
|
|
212
|
+
|
|
213
|
+
7. `--dry-run` always exits 0 even when it finds files needing normalization.
|
|
214
|
+
CI pipelines need a non-zero exit to catch violations. Add `--fail-on-changes`
|
|
215
|
+
or make dry-run exit 1 when changes are detected.
|
|
216
|
+
|
|
217
|
+
**Cleanup:**
|
|
218
|
+
|
|
219
|
+
8. `code_normalize_pro.py` at root -- stale copy. Real file is `src/`. Delete it.
|
|
220
|
+
9. `roadmaps/New Text Document.txt` -- empty temp file. Delete it.
|
|
221
|
+
10. `roadmaps/talking about code.txt` -- saved AI chat session. Delete or move to docs/.
|
|
222
|
+
11. All `README_20260220_*.md.bak` files throughout the tree -- ReadmeForge backups.
|
|
223
|
+
12. `config/settings.py` is a clean env-var loader but nothing imports it.
|
|
224
|
+
Either wire it into `code_normalize_pro.py` or remove it.
|
|
225
|
+
13. `README_PRO.md` at root duplicates `docs/README.md`. Consolidate.
|
|
226
|
+
14. `restore_report.json` and `smoke_report.json` at root -- generated artifacts,
|
|
227
|
+
add to `.gitignore`.
|
|
228
|
+
15. `PROJECT_STATUS.md` says roadmap docs are "coming soon" -- all 6 exist. Stale.
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Launch Status (Path 1 - Solo Dev Tool)
|
|
233
|
+
|
|
234
|
+
EXECUTION_PLAN.md has a 7-day checklist. As of 2026-03-10, nothing started.
|
|
235
|
+
|
|
236
|
+
Before Day 1 tasks will work, pyproject.toml needs to exist (see issue #1 above).
|
|
237
|
+
|
|
238
|
+
Day 1 after pyproject.toml is in place:
|
|
239
|
+
|
|
240
|
+
```powershell
|
|
241
|
+
Set-Location C:\Dev\PROJECTS\CODE
|
|
242
|
+
.\.venv\Scripts\Activate.ps1
|
|
243
|
+
python -m pytest -q
|
|
244
|
+
pip install -e .
|
|
245
|
+
code-normalizer-pro --help
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Full release steps: see `docs/release/alpha_release_checklist.md`
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## CI
|
|
253
|
+
|
|
254
|
+
`.github/workflows/ci.yml` runs on push to main/master and on PRs:
|
|
255
|
+
- Python 3.11
|
|
256
|
+
- pip install from requirements.txt
|
|
257
|
+
- CLI smoke check (main.py and src/code_normalize_pro.py --help)
|
|
258
|
+
- pytest -q
|
|
259
|
+
- python -m build (sdist + wheel)
|
|
260
|
+
|
|
261
|
+
Note: `python -m build` requires `pyproject.toml`. CI will fail until that exists.
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## Version History
|
|
266
|
+
|
|
267
|
+
| Version | Date | Changes |
|
|
268
|
+
|---------|------------|---------|
|
|
269
|
+
| v3.0 | 2026-02-09 | Parallel processing, SHA256 caching, pre-commit hooks, multi-language syntax, interactive mode |
|
|
270
|
+
| v2.0 | 2026-02-09 | Dry-run, in-place editing, backups, tqdm, detailed stats |
|
|
271
|
+
| v1.0 | -- | Basic encoding fix, CRLF, whitespace |
|
|
272
|
+
|
|
273
|
+
Package version: 3.0.1 (set in `code_normalizer_pro/__init__.py`)
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
Developer: MR (Michael Rawls Jr.) -- Houston, TX -- GitHub: MRJR0101
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""Console entry point for the code-normalizer-pro installed package.
|
|
2
|
+
|
|
3
|
+
Uses runpy so the core script (src/code_normalize_pro.py) does not need
|
|
4
|
+
to be a proper importable module. Works correctly under editable installs
|
|
5
|
+
(pip install -e .). Before building a wheel for PyPI distribution, copy
|
|
6
|
+
src/code_normalize_pro.py into this package directory and update
|
|
7
|
+
_find_script() to look for it there.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import runpy
|
|
13
|
+
import sys
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _find_script() -> Path:
|
|
18
|
+
"""Return the path to code_normalize_pro.py.
|
|
19
|
+
|
|
20
|
+
Search order:
|
|
21
|
+
1. src/ next to package root -- editable / dev install
|
|
22
|
+
2. Inside this package dir -- future bundled layout
|
|
23
|
+
"""
|
|
24
|
+
pkg_dir = Path(__file__).resolve().parent # code_normalizer_pro/
|
|
25
|
+
root = pkg_dir.parent
|
|
26
|
+
candidates = [
|
|
27
|
+
root / "src" / "code_normalize_pro.py", # editable install
|
|
28
|
+
pkg_dir / "code_normalize_pro.py", # future bundled
|
|
29
|
+
]
|
|
30
|
+
for p in candidates:
|
|
31
|
+
if p.is_file():
|
|
32
|
+
return p
|
|
33
|
+
checked = ", ".join(str(c) for c in candidates)
|
|
34
|
+
raise FileNotFoundError(
|
|
35
|
+
f"code_normalize_pro.py not found. Checked: {checked}"
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def main() -> None:
|
|
40
|
+
script = _find_script()
|
|
41
|
+
sys.argv[0] = str(script)
|
|
42
|
+
runpy.run_path(str(script), run_name="__main__")
|