Skip to content

Commit 62fac87

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 454d20a commit 62fac87

5 files changed

Lines changed: 91 additions & 50 deletions

File tree

followup-reply.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1-
Thanks @hugovk — fair point on the health score. I've reverted the ternaries and fixed the 3.10 timezone issue in the earlier push; this update adds a broader auto-fix pass (format/refactor/ruff aligned with your ruff config) plus a few targeted refactors: suffix lookup in `naturalsize`, `_today_for_value()` to dedupe the `naturalday`/`naturaldate` today logic, and the other safe changes listed in **Changes brought**.
1+
Thanks @hugovk — fair point on the health score. I've reverted the ternaries and fixed
2+
the 3.10 timezone issue in the earlier push; this update adds a broader auto-fix pass
3+
(format/refactor/ruff aligned with your ruff config) plus a few targeted refactors:
4+
suffix lookup in `naturalsize`, `_today_for_value()` to dedupe the
5+
`naturalday`/`naturaldate` today logic, and the other safe changes listed in **Changes
6+
brought**.
27

3-
CI was green on my side after the revert push (`pre-commit.ci` + RTD). I can't add `changelog:*` labels from the fork — could you add one when you have a moment? Happy to adjust anything that's still not what you want.
8+
CI was green on my side after the revert push (`pre-commit.ci` + RTD). I can't add
9+
`changelog:*` labels from the fork — could you add one when you have a moment? Happy to
10+
adjust anything that's still not what you want.

pr-body.md

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22

33
**Repo health:** 68/100
44

5-
Our analysis found **90 format issues** and about **49 refactoring opportunities** across the reviewed scope. Security scans (gitleaks, bandit, semgrep) were clean; pip-audit reported no known vulnerabilities. Python code duplication is low (~0.7% in `.py` files). Radon maintainability ranks are mostly A-grade, but several functions exceed cyclomatic-complexity thresholds — notably `naturaldelta` and `precisedelta` in `time.py`. This pull request applies an **auto-fix pass** aligned with your project config — **5 files**, ~46 focused line changes — plus a few targeted refactors; it is not a complete cleanup of every finding.
5+
Our analysis found **90 format issues** and about **49 refactoring opportunities**
6+
across the reviewed scope. Security scans (gitleaks, bandit, semgrep) were clean;
7+
pip-audit reported no known vulnerabilities. Python code duplication is low (~0.7% in
8+
`.py` files). Radon maintainability ranks are mostly A-grade, but several functions
9+
exceed cyclomatic-complexity thresholds — notably `naturaldelta` and `precisedelta` in
10+
`time.py`. This pull request applies an **auto-fix pass** aligned with your project
11+
config — **5 files**, ~46 focused line changes — plus a few targeted refactors; it is
12+
not a complete cleanup of every finding.
613

714
## What you are doing right
815

@@ -22,37 +29,43 @@ Our analysis found **90 format issues** and about **49 refactoring opportunities
2229

2330
**Duplicate code (follow-up)**
2431

25-
- ~0.7% duplication in Python — primary clone: `time.py` today-calculation for `naturalday` / `naturaldate`**partially addressed** by extracting `_today_for_value`.
32+
- ~0.7% duplication in Python — primary clone: `time.py` today-calculation for
33+
`naturalday` / `naturaldate`**partially addressed** by extracting
34+
`_today_for_value`.
2635

2736
**Refactoring (~49 opportunities; sample in this PR)**
2837

2938
- Collapse suffix selection in `naturalsize` (`filesize.py`) — **included in this PR**.
3039
- Flatten `natural_list` branching (`lists.py`) — **included in this PR**.
3140
- Remove redundant `int()` cast in `metric` (`number.py`) — **included in this PR**.
32-
- Yoda comparison fix and `zip(..., strict=True)` in `time.py`**included in this PR**.
41+
- Yoda comparison fix and `zip(..., strict=True)` in `time.py`**included in this
42+
PR**.
3343
- Deeper `naturaldelta` branch simplification — follow-up (larger change).
3444

3545
**Lint / style (defer)**
3646

37-
- Many findings reflect intentional API choices (boolean positional args, `format` parameter name, pytest parametrize style).
47+
- Many findings reflect intentional API choices (boolean positional args, `format`
48+
parameter name, pytest parametrize style).
3849

3950
## Changes brought
4051

41-
| Pass | Files | Fixes / notes | Manual? |
42-
| --- | --- | --- | --- |
43-
| `shipgate format --target .` | 0 | Codebase already formatted; skipped pyproject rule renames | no |
44-
| `shipgate refactor fix` | 0 | No remaining auto-fixable refactors in `src/humanize/` | no |
45-
| `ruff check --fix` (pyproject `[tool.ruff]`) | 1 | RUF046 redundant `int()` in `metric()` | no |
46-
| Targeted safe refactors | 4 | `lists` elif flatten; `filesize` suffix lookup; `_today_for_value` dedup; `zip(..., strict=True)` | yes |
47-
| Revert ternaries (review) | 2 | Restored `if`/`else` per maintainer feedback | revert only |
48-
| **Net in PR** | **5** | | **0** new manual |
52+
| Pass | Files | Fixes / notes | Manual? |
53+
| -------------------------------------------- | ----- | ------------------------------------------------------------------------------------------------- | ---------------- |
54+
| `shipgate format --target .` | 0 | Codebase already formatted; skipped pyproject rule renames | no |
55+
| `shipgate refactor fix` | 0 | No remaining auto-fixable refactors in `src/humanize/` | no |
56+
| `ruff check --fix` (pyproject `[tool.ruff]`) | 1 | RUF046 redundant `int()` in `metric()` | no |
57+
| Targeted safe refactors | 4 | `lists` elif flatten; `filesize` suffix lookup; `_today_for_value` dedup; `zip(..., strict=True)` | yes |
58+
| Revert ternaries (review) | 2 | Restored `if`/`else` per maintainer feedback | revert only |
59+
| **Net in PR** | **5** | | **0** new manual |
4960

5061
## Changes
5162

5263
- `src/humanize/lists.py`: flatten `natural_list` branching; use `!s` conversion.
5364
- `src/humanize/filesize.py`: collapse suffix selection into a single lookup.
54-
- `src/humanize/number.py`: remove redundant `int()` around `max()` and `math.floor()` in `metric()`.
55-
- `src/humanize/time.py`: extract `_today_for_value()` for `naturalday` / `naturaldate`; yoda comparison fix; `zip(..., strict=True)` in `precisedelta`.
65+
- `src/humanize/number.py`: remove redundant `int()` around `max()` and `math.floor()`
66+
in `metric()`.
67+
- `src/humanize/time.py`: extract `_today_for_value()` for `naturalday` / `naturaldate`;
68+
yoda comparison fix; `zip(..., strict=True)` in `precisedelta`.
5669
- `tests/test_time.py`: `zip(..., strict=True)` in `_date_and_delta` test.
5770

5871
## Verification
@@ -66,14 +79,18 @@ Our analysis found **90 format issues** and about **49 refactoring opportunities
6679
<details>
6780
<summary>Other findings (not in this example PR)</summary>
6881

69-
| area | finding | note |
70-
| --- | --- | --- |
71-
| Complexity | `naturaldelta` CC 33 | Deferred — larger refactor |
72-
| Complexity | `precisedelta` CC 26 | Deferred |
73-
| Lint | Boolean positional args (FBT) | Intentional public API |
74-
| Lint | `format` parameter name (A002) | Stable API surface |
82+
| area | finding | note |
83+
| ---------- | ------------------------------ | -------------------------- |
84+
| Complexity | `naturaldelta` CC 33 | Deferred — larger refactor |
85+
| Complexity | `precisedelta` CC 26 | Deferred |
86+
| Lint | Boolean positional args (FBT) | Intentional public API |
87+
| Lint | `format` parameter name (A002) | Stable API surface |
7588

7689
</details>
7790

7891
---
79-
*We're testing [ShipGate](https://github.com/inquilabee/shipgate) on real-world projects to learn whether it works well in practice. This review summary was generated from ShipGate check output and AI-assisted analysis. Feedback on the findings or approach is welcome and appreciated — [docs](https://inquilabee.github.io/shipgate/).*
92+
93+
_We're testing [ShipGate](https://github.com/inquilabee/shipgate) on real-world projects
94+
to learn whether it works well in practice. This review summary was generated from
95+
ShipGate check output and AI-assisted analysis. Feedback on the findings or approach is
96+
welcome and appreciated — [docs](https://inquilabee.github.io/shipgate/)._

shipgate-review/FINDINGS.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
Captured 2026-07-30 during follow-up auto-expand pass.
44

5-
| Artifact | Description |
6-
| --- | --- |
7-
| `check.out` | `shipgate check --suite full --target .` |
8-
| `refactor-strict.out` | `shipgate refactor check --strict .` |
9-
| `format.out` | `shipgate format --target .` |
5+
| Artifact | Description |
6+
| --------------------- | ---------------------------------------- |
7+
| `check.out` | `shipgate check --suite full --target .` |
8+
| `refactor-strict.out` | `shipgate refactor check --strict .` |
9+
| `format.out` | `shipgate format --target .` |
1010

1111
## Counts (from captures)
1212

shipgate-review/SUMMARY.md

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22

33
**Repo health:** 68/100
44

5-
Our analysis found **90 format issues** and about **49 refactoring opportunities** across the reviewed scope. Security scans (gitleaks, bandit, semgrep) were clean; pip-audit reported no known vulnerabilities. Python code duplication is low (~0.7% in `.py` files). Radon maintainability ranks are mostly A-grade, but several functions exceed cyclomatic-complexity thresholds — notably `naturaldelta` and `precisedelta` in `time.py`. This pull request applies an **auto-fix pass** aligned with your project config — **5 files**, ~46 focused line changes — plus a few targeted refactors; it is not a complete cleanup of every finding.
5+
Our analysis found **90 format issues** and about **49 refactoring opportunities**
6+
across the reviewed scope. Security scans (gitleaks, bandit, semgrep) were clean;
7+
pip-audit reported no known vulnerabilities. Python code duplication is low (~0.7% in
8+
`.py` files). Radon maintainability ranks are mostly A-grade, but several functions
9+
exceed cyclomatic-complexity thresholds — notably `naturaldelta` and `precisedelta` in
10+
`time.py`. This pull request applies an **auto-fix pass** aligned with your project
11+
config — **5 files**, ~46 focused line changes — plus a few targeted refactors; it is
12+
not a complete cleanup of every finding.
613

714
## What you are doing right
815

@@ -22,37 +29,43 @@ Our analysis found **90 format issues** and about **49 refactoring opportunities
2229

2330
**Duplicate code (follow-up)**
2431

25-
- ~0.7% duplication in Python — primary clone: `time.py` today-calculation for `naturalday` / `naturaldate`**partially addressed** by extracting `_today_for_value`.
32+
- ~0.7% duplication in Python — primary clone: `time.py` today-calculation for
33+
`naturalday` / `naturaldate`**partially addressed** by extracting
34+
`_today_for_value`.
2635

2736
**Refactoring (~49 opportunities; sample in this PR)**
2837

2938
- Collapse suffix selection in `naturalsize` (`filesize.py`) — **included in this PR**.
3039
- Flatten `natural_list` branching (`lists.py`) — **included in this PR**.
3140
- Remove redundant `int()` cast in `metric` (`number.py`) — **included in this PR**.
32-
- Yoda comparison fix and `zip(..., strict=True)` in `time.py`**included in this PR**.
41+
- Yoda comparison fix and `zip(..., strict=True)` in `time.py`**included in this
42+
PR**.
3343
- Deeper `naturaldelta` branch simplification — follow-up (larger change).
3444

3545
**Lint / style (defer)**
3646

37-
- Many findings reflect intentional API choices (boolean positional args, `format` parameter name, pytest parametrize style).
47+
- Many findings reflect intentional API choices (boolean positional args, `format`
48+
parameter name, pytest parametrize style).
3849

3950
## Changes brought
4051

41-
| Pass | Files | Fixes / notes | Manual? |
42-
| --- | --- | --- | --- |
43-
| `shipgate format --target .` | 0 | Codebase already formatted; skipped pyproject rule renames | no |
44-
| `shipgate refactor fix` | 0 | No remaining auto-fixable refactors in `src/humanize/` | no |
45-
| `ruff check --fix` (pyproject `[tool.ruff]`) | 1 | RUF046 redundant `int()` in `metric()` | no |
46-
| Targeted safe refactors | 4 | `lists` elif flatten; `filesize` suffix lookup; `_today_for_value` dedup; `zip(..., strict=True)` | yes |
47-
| Revert ternaries (review) | 2 | Restored `if`/`else` per maintainer feedback | revert only |
48-
| **Net in PR** | **5** | | **0** new manual |
52+
| Pass | Files | Fixes / notes | Manual? |
53+
| -------------------------------------------- | ----- | ------------------------------------------------------------------------------------------------- | ---------------- |
54+
| `shipgate format --target .` | 0 | Codebase already formatted; skipped pyproject rule renames | no |
55+
| `shipgate refactor fix` | 0 | No remaining auto-fixable refactors in `src/humanize/` | no |
56+
| `ruff check --fix` (pyproject `[tool.ruff]`) | 1 | RUF046 redundant `int()` in `metric()` | no |
57+
| Targeted safe refactors | 4 | `lists` elif flatten; `filesize` suffix lookup; `_today_for_value` dedup; `zip(..., strict=True)` | yes |
58+
| Revert ternaries (review) | 2 | Restored `if`/`else` per maintainer feedback | revert only |
59+
| **Net in PR** | **5** | | **0** new manual |
4960

5061
## Changes
5162

5263
- `src/humanize/lists.py`: flatten `natural_list` branching; use `!s` conversion.
5364
- `src/humanize/filesize.py`: collapse suffix selection into a single lookup.
54-
- `src/humanize/number.py`: remove redundant `int()` around `max()` and `math.floor()` in `metric()`.
55-
- `src/humanize/time.py`: extract `_today_for_value()` for `naturalday` / `naturaldate`; yoda comparison fix; `zip(..., strict=True)` in `precisedelta`.
65+
- `src/humanize/number.py`: remove redundant `int()` around `max()` and `math.floor()`
66+
in `metric()`.
67+
- `src/humanize/time.py`: extract `_today_for_value()` for `naturalday` / `naturaldate`;
68+
yoda comparison fix; `zip(..., strict=True)` in `precisedelta`.
5669
- `tests/test_time.py`: `zip(..., strict=True)` in `_date_and_delta` test.
5770

5871
## Verification
@@ -66,14 +79,18 @@ Our analysis found **90 format issues** and about **49 refactoring opportunities
6679
<details>
6780
<summary>Other findings (not in this example PR)</summary>
6881

69-
| area | finding | note |
70-
| --- | --- | --- |
71-
| Complexity | `naturaldelta` CC 33 | Deferred — larger refactor |
72-
| Complexity | `precisedelta` CC 26 | Deferred |
73-
| Lint | Boolean positional args (FBT) | Intentional public API |
74-
| Lint | `format` parameter name (A002) | Stable API surface |
82+
| area | finding | note |
83+
| ---------- | ------------------------------ | -------------------------- |
84+
| Complexity | `naturaldelta` CC 33 | Deferred — larger refactor |
85+
| Complexity | `precisedelta` CC 26 | Deferred |
86+
| Lint | Boolean positional args (FBT) | Intentional public API |
87+
| Lint | `format` parameter name (A002) | Stable API surface |
7588

7689
</details>
7790

7891
---
79-
*We're testing [ShipGate](https://github.com/inquilabee/shipgate) on real-world projects to learn whether it works well in practice. This review summary was generated from ShipGate check output and AI-assisted analysis. Feedback on the findings or approach is welcome and appreciated — [docs](https://inquilabee.github.io/shipgate/).*
92+
93+
_We're testing [ShipGate](https://github.com/inquilabee/shipgate) on real-world projects
94+
to learn whether it works well in practice. This review summary was generated from
95+
ShipGate check output and AI-assisted analysis. Feedback on the findings or approach is
96+
welcome and appreciated — [docs](https://inquilabee.github.io/shipgate/)._

shipgate-review/check.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ import-linter.check: error: TOOL_EXIT ╔══╗─────────▶
316316
║║╔══╣╔╗║╔╗║╔╣║ ║║ ╔╬╣╔╗║║ ║│║╔═╝
317317
╔╣╠╣║║║╚╝║╚╝║║║╚╗║╚═╝║║║║║╚╗║═╣║
318318
╚══╩╩╩╣╔═╩══╩╝╚═╝╚═══╩╩╝╚╩═╩╩═╩╝
319-
└──▶║║ ▲
319+
└──▶║║ ▲
320320
╚╝────────────────────┘
321321

322322
Could not find package 'humanize' in your Python path.

0 commit comments

Comments
 (0)