whycode-cli 0.2.0__py3-none-any.whl → 0.2.1__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.
- whycode/__init__.py +1 -1
- whycode/templates/github-workflow.yml +10 -12
- {whycode_cli-0.2.0.dist-info → whycode_cli-0.2.1.dist-info}/METADATA +12 -9
- {whycode_cli-0.2.0.dist-info → whycode_cli-0.2.1.dist-info}/RECORD +8 -8
- {whycode_cli-0.2.0.dist-info → whycode_cli-0.2.1.dist-info}/WHEEL +0 -0
- {whycode_cli-0.2.0.dist-info → whycode_cli-0.2.1.dist-info}/entry_points.txt +0 -0
- {whycode_cli-0.2.0.dist-info → whycode_cli-0.2.1.dist-info}/licenses/LICENSE +0 -0
- {whycode_cli-0.2.0.dist-info → whycode_cli-0.2.1.dist-info}/top_level.txt +0 -0
whycode/__init__.py
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
# Risk-
|
|
1
|
+
# Risk-rank pull requests with WhyCode.
|
|
2
2
|
#
|
|
3
3
|
# On every PR this workflow computes the Risk Card for each changed file
|
|
4
|
-
# (vs the PR base) and
|
|
5
|
-
#
|
|
6
|
-
# - exits non-zero if any file reaches the band you choose, blocking merge
|
|
4
|
+
# (vs the PR base) and prints a risk-ranked table to the job log.
|
|
5
|
+
# Advisory by default — humans decide.
|
|
7
6
|
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
# Remove `--fail-on` entirely to make WhyCode advisory only.
|
|
7
|
+
# To turn it into a hard gate that blocks merging, append `--fail-on <band>`
|
|
8
|
+
# to the `whycode diff` line below:
|
|
9
|
+
# handle block at HANDLE WITH CARE (score >= 75)
|
|
10
|
+
# history block at READ HISTORY FIRST (score >= 50)
|
|
11
|
+
# look stricter — block at >= 25
|
|
14
12
|
name: WhyCode
|
|
15
13
|
|
|
16
14
|
on:
|
|
@@ -36,7 +34,7 @@ jobs:
|
|
|
36
34
|
python-version: "3.11"
|
|
37
35
|
|
|
38
36
|
- name: Install WhyCode
|
|
39
|
-
run: pip install
|
|
37
|
+
run: pip install whycode-cli
|
|
40
38
|
|
|
41
39
|
- name: Risk-rank files in this PR
|
|
42
|
-
run: whycode diff --base origin/${{ github.base_ref }}
|
|
40
|
+
run: whycode diff --base origin/${{ github.base_ref }}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: whycode-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Tells you what to be afraid of before you touch a file.
|
|
5
5
|
Author: Kevin
|
|
6
6
|
License-Expression: MIT
|
|
@@ -67,13 +67,14 @@ decide what to do.
|
|
|
67
67
|
|
|
68
68
|
## Install
|
|
69
69
|
|
|
70
|
-
Once published to PyPI:
|
|
71
|
-
|
|
72
70
|
```bash
|
|
73
|
-
pip install whycode
|
|
71
|
+
pip install whycode-cli
|
|
74
72
|
```
|
|
75
73
|
|
|
76
|
-
|
|
74
|
+
The PyPI distribution is `whycode-cli` (the bare name `whycode` was already
|
|
75
|
+
taken by an unrelated project); the installed command is still `whycode`.
|
|
76
|
+
|
|
77
|
+
From source, if you want to track `main`:
|
|
77
78
|
|
|
78
79
|
```bash
|
|
79
80
|
pip install git+https://github.com/fangshuor/WhyCode.git
|
|
@@ -177,11 +178,13 @@ That installs two things:
|
|
|
177
178
|
- **`.git/hooks/pre-commit`** — runs `whycode diff --staged --fail-on handle`
|
|
178
179
|
before every commit. HANDLE WITH CARE files can't be touched without an
|
|
179
180
|
explicit `git commit --no-verify`.
|
|
180
|
-
- **`.github/workflows/whycode.yml`** — a GitHub Action that
|
|
181
|
-
|
|
181
|
+
- **`.github/workflows/whycode.yml`** — a GitHub Action that prints a
|
|
182
|
+
risk-ranked table for every PR. Advisory by default (never blocks merging);
|
|
183
|
+
append `--fail-on history` (or `handle` / `look`) to the diff line to turn
|
|
184
|
+
it into a hard gate.
|
|
182
185
|
|
|
183
|
-
Tune the
|
|
184
|
-
|
|
186
|
+
Tune the thresholds inside those two files for your repo. Re-run with
|
|
187
|
+
`whycode init --force` to overwrite.
|
|
185
188
|
|
|
186
189
|
**MCP server** — see the next section.
|
|
187
190
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
whycode/__init__.py,sha256=
|
|
1
|
+
whycode/__init__.py,sha256=jJnNmctGBHLWNIpQ6nSfkbHd9x-7trhSglEmlsrULME,96
|
|
2
2
|
whycode/__main__.py,sha256=dqAk6746YpuM-FTIH4TBOULegGc5WweojiZjce0VYgQ,105
|
|
3
3
|
whycode/cli.py,sha256=9e2lUpAFamzmwS1ixtk8TxW49gDpXlBq0oQ5r9I5mR4,24391
|
|
4
4
|
whycode/git_facts.py,sha256=qn4ctE6RkkGa5sFq9ZYjT7UlKIcZnmjSQkOE8NkgvcY,15177
|
|
@@ -7,11 +7,11 @@ whycode/risk_card.py,sha256=IuQTfSeKwjC6RCmbXXT012xEODESonRBmZKcfvDwAOY,6479
|
|
|
7
7
|
whycode/scorer.py,sha256=4pBejunfxzYhGUzMeL8uGEMQzC6DWiqwcTeMdo3eras,1444
|
|
8
8
|
whycode/signals.py,sha256=14KziRolXvhmOnMnluXpPPInoBRO5uDu0tm024EYik0,13066
|
|
9
9
|
whycode/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
-
whycode/templates/github-workflow.yml,sha256=
|
|
10
|
+
whycode/templates/github-workflow.yml,sha256=yy87tbYKCexNYFso4e4OxGAdIIYOLn2cVxEt-FzP2oo,1095
|
|
11
11
|
whycode/templates/pre-commit,sha256=IhU11CvoDwqRAAsvHwUo-BwaNbdgy1cpXc54Z_phrmQ,316
|
|
12
|
-
whycode_cli-0.2.
|
|
13
|
-
whycode_cli-0.2.
|
|
14
|
-
whycode_cli-0.2.
|
|
15
|
-
whycode_cli-0.2.
|
|
16
|
-
whycode_cli-0.2.
|
|
17
|
-
whycode_cli-0.2.
|
|
12
|
+
whycode_cli-0.2.1.dist-info/licenses/LICENSE,sha256=U6LN5qg5kJXSJf7KFPm9KJhmiGn3qK_GsTVWXdt1DFA,1062
|
|
13
|
+
whycode_cli-0.2.1.dist-info/METADATA,sha256=W9iwebvjq96Ry9P-6I3NDwA1TPOcu403hDVxwVT1-aM,9100
|
|
14
|
+
whycode_cli-0.2.1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
15
|
+
whycode_cli-0.2.1.dist-info/entry_points.txt,sha256=xrNWc4CQn3ZhQFJxsGIPiTqpN19K4pRpgaj6qGaEzSQ,44
|
|
16
|
+
whycode_cli-0.2.1.dist-info/top_level.txt,sha256=6yIL5rxW-4DbARHQYrPlGQVqKddZ88sjvmNosDh1w3A,8
|
|
17
|
+
whycode_cli-0.2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|