whycode-cli 0.2.0__tar.gz → 0.2.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.
Files changed (27) hide show
  1. {whycode_cli-0.2.0/src/whycode_cli.egg-info → whycode_cli-0.2.1}/PKG-INFO +12 -9
  2. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/README.md +11 -8
  3. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/pyproject.toml +1 -1
  4. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/src/whycode/__init__.py +1 -1
  5. whycode_cli-0.2.1/src/whycode/templates/github-workflow.yml +40 -0
  6. {whycode_cli-0.2.0 → whycode_cli-0.2.1/src/whycode_cli.egg-info}/PKG-INFO +12 -9
  7. whycode_cli-0.2.0/src/whycode/templates/github-workflow.yml +0 -42
  8. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/LICENSE +0 -0
  9. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/setup.cfg +0 -0
  10. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/src/whycode/__main__.py +0 -0
  11. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/src/whycode/cli.py +0 -0
  12. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/src/whycode/git_facts.py +0 -0
  13. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/src/whycode/mcp_server.py +0 -0
  14. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/src/whycode/risk_card.py +0 -0
  15. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/src/whycode/scorer.py +0 -0
  16. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/src/whycode/signals.py +0 -0
  17. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/src/whycode/templates/__init__.py +0 -0
  18. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/src/whycode/templates/pre-commit +0 -0
  19. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/src/whycode_cli.egg-info/SOURCES.txt +0 -0
  20. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/src/whycode_cli.egg-info/dependency_links.txt +0 -0
  21. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/src/whycode_cli.egg-info/entry_points.txt +0 -0
  22. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/src/whycode_cli.egg-info/requires.txt +0 -0
  23. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/src/whycode_cli.egg-info/top_level.txt +0 -0
  24. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/tests/test_cli.py +0 -0
  25. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/tests/test_git_facts.py +0 -0
  26. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/tests/test_scorer.py +0 -0
  27. {whycode_cli-0.2.0 → whycode_cli-0.2.1}/tests/test_signals.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: whycode-cli
3
- Version: 0.2.0
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
- From source (current canonical path):
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 risk-ranks every
181
- PR's files and fails the build at `--fail-on history` ( READ HISTORY FIRST).
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 `--fail-on` thresholds inside those two files for your repo. Re-run
184
- with `whycode init --force` to overwrite.
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
 
@@ -39,13 +39,14 @@ decide what to do.
39
39
 
40
40
  ## Install
41
41
 
42
- Once published to PyPI:
43
-
44
42
  ```bash
45
- pip install whycode
43
+ pip install whycode-cli
46
44
  ```
47
45
 
48
- From source (current canonical path):
46
+ The PyPI distribution is `whycode-cli` (the bare name `whycode` was already
47
+ taken by an unrelated project); the installed command is still `whycode`.
48
+
49
+ From source, if you want to track `main`:
49
50
 
50
51
  ```bash
51
52
  pip install git+https://github.com/fangshuor/WhyCode.git
@@ -149,11 +150,13 @@ That installs two things:
149
150
  - **`.git/hooks/pre-commit`** — runs `whycode diff --staged --fail-on handle`
150
151
  before every commit. HANDLE WITH CARE files can't be touched without an
151
152
  explicit `git commit --no-verify`.
152
- - **`.github/workflows/whycode.yml`** — a GitHub Action that risk-ranks every
153
- PR's files and fails the build at `--fail-on history` ( READ HISTORY FIRST).
153
+ - **`.github/workflows/whycode.yml`** — a GitHub Action that prints a
154
+ risk-ranked table for every PR. Advisory by default (never blocks merging);
155
+ append `--fail-on history` (or `handle` / `look`) to the diff line to turn
156
+ it into a hard gate.
154
157
 
155
- Tune the `--fail-on` thresholds inside those two files for your repo. Re-run
156
- with `whycode init --force` to overwrite.
158
+ Tune the thresholds inside those two files for your repo. Re-run with
159
+ `whycode init --force` to overwrite.
157
160
 
158
161
  **MCP server** — see the next section.
159
162
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "whycode-cli"
7
- version = "0.2.0"
7
+ version = "0.2.1"
8
8
  description = "Tells you what to be afraid of before you touch a file."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -1,3 +1,3 @@
1
1
  """WhyCode — tells you what to be afraid of before touching a file."""
2
2
 
3
- __version__ = "0.2.0"
3
+ __version__ = "0.2.1"
@@ -0,0 +1,40 @@
1
+ # Risk-rank pull requests with WhyCode.
2
+ #
3
+ # On every PR this workflow computes the Risk Card for each changed file
4
+ # (vs the PR base) and prints a risk-ranked table to the job log.
5
+ # Advisory by default — humans decide.
6
+ #
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
12
+ name: WhyCode
13
+
14
+ on:
15
+ pull_request:
16
+ types: [opened, synchronize, reopened]
17
+
18
+ permissions:
19
+ contents: read
20
+ pull-requests: read
21
+
22
+ jobs:
23
+ whycode:
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - name: Check out PR
27
+ uses: actions/checkout@v4
28
+ with:
29
+ fetch-depth: 0 # WhyCode needs full history
30
+
31
+ - name: Set up Python
32
+ uses: actions/setup-python@v5
33
+ with:
34
+ python-version: "3.11"
35
+
36
+ - name: Install WhyCode
37
+ run: pip install whycode-cli
38
+
39
+ - name: Risk-rank files in this PR
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.0
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
- From source (current canonical path):
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 risk-ranks every
181
- PR's files and fails the build at `--fail-on history` ( READ HISTORY FIRST).
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 `--fail-on` thresholds inside those two files for your repo. Re-run
184
- with `whycode init --force` to overwrite.
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,42 +0,0 @@
1
- # Risk-gates pull requests with WhyCode.
2
- #
3
- # On every PR this workflow computes the Risk Card for each changed file
4
- # (vs the PR base) and:
5
- # - prints a risk-ranked table to the job log
6
- # - exits non-zero if any file reaches the band you choose, blocking merge
7
- #
8
- # Tune `--fail-on` to taste:
9
- # handle block PRs touching files >= HANDLE WITH CARE (>= 75)
10
- # history block PRs touching files >= READ HISTORY FIRST (>= 50)
11
- # look stricter; block at >= 25 (probably too noisy)
12
- #
13
- # Remove `--fail-on` entirely to make WhyCode advisory only.
14
- name: WhyCode
15
-
16
- on:
17
- pull_request:
18
- types: [opened, synchronize, reopened]
19
-
20
- permissions:
21
- contents: read
22
- pull-requests: read
23
-
24
- jobs:
25
- whycode:
26
- runs-on: ubuntu-latest
27
- steps:
28
- - name: Check out PR
29
- uses: actions/checkout@v4
30
- with:
31
- fetch-depth: 0 # WhyCode needs full history
32
-
33
- - name: Set up Python
34
- uses: actions/setup-python@v5
35
- with:
36
- python-version: "3.11"
37
-
38
- - name: Install WhyCode
39
- run: pip install git+https://github.com/fangshuor/WhyCode.git
40
-
41
- - name: Risk-rank files in this PR
42
- run: whycode diff --base origin/${{ github.base_ref }} --fail-on history
File without changes
File without changes