Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/using-diffci.md
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,8 @@ _Module resource and dependency impact contributed by [@FredApps](https://github

These appear only in Python projects (a root `pyproject.toml`, `setup.py`, `setup.cfg`, `pytest.toml`, `.pytest.toml`, `pytest.ini`, `.pytest.ini`, `tox.ini` or `conftest.py`). A changed project file such as `pyproject.toml` or `requirements.txt` falls back under `Configuration file(s) changed`.

When a change to `uv.toml`, `poetry.toml`, `pdm.toml` or `hatch.toml` already requires the full suite, DiffCI reports `Tool configuration changed: Python packaging settings`. For `.coveragerc`, it reports `Tool configuration changed: coverage settings`.

| Reason | Example change | Narrow |
| --- | --- | --- |
| `Python file could not be parsed (…): …` | A `.py` file with a syntax error | Fix: make the file parse |
Expand Down
11 changes: 9 additions & 2 deletions src/repo/impact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,15 @@ function toolConfigurationSubject(filePath: string): string | undefined {

// Name these settings only after reader resolution or the orphan-code check requires a full run.
function toolConfigurationReason(filePath: string, subject?: string): string | undefined {
if (!subject && [".yarnrc.yml", ".yarnrc", "bunfig.toml", ".pnpmfile.cjs"].includes(posix.basename(filePath))) {
subject = "package manager settings";
if (!subject) {
const base = posix.basename(filePath);
if ([".yarnrc.yml", ".yarnrc", "bunfig.toml", ".pnpmfile.cjs"].includes(base)) {
subject = "package manager settings";
} else if (["uv.toml", "poetry.toml", "pdm.toml", "hatch.toml"].includes(base)) {
subject = "Python packaging settings";
} else if (base === ".coveragerc") {
subject = "coverage settings";
}
}
return subject && `Tool configuration changed: ${subject} (${filePath}); full validation required`;
}
Expand Down
5 changes: 5 additions & 0 deletions tests/repo/tool-config-reasons.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ const CASES: Array<{ file: string; before: string; after: string; reason: string
{ file: ".yarnrc", before: 'save-prefix "~"\n', after: 'save-prefix "^"\n', reason: "Tool configuration changed: package manager settings" },
{ file: "bunfig.toml", before: "[install]\nexact = false\n", after: "[install]\nexact = true\n", reason: "Tool configuration changed: package manager settings" },
{ file: ".pnpmfile.cjs", before: "module.exports = {};\n", after: "module.exports = { hooks: {} };\n", reason: "Tool configuration changed: package manager settings" },
{ file: "uv.toml", before: "offline = false\n", after: "offline = true\n", reason: "Tool configuration changed: Python packaging settings" },
{ file: "poetry.toml", before: "[virtualenvs]\nin-project = false\n", after: "[virtualenvs]\nin-project = true\n", reason: "Tool configuration changed: Python packaging settings" },
{ file: "pdm.toml", before: "[venv]\nin_project = false\n", after: "[venv]\nin_project = true\n", reason: "Tool configuration changed: Python packaging settings" },
{ file: "hatch.toml", before: '[dirs]\ncache = "cache-a"\n', after: '[dirs]\ncache = "cache-b"\n', reason: "Tool configuration changed: Python packaging settings" },
{ file: ".coveragerc", before: "[report]\nfail_under = 80\n", after: "[report]\nfail_under = 90\n", reason: "Tool configuration changed: coverage settings" },
// Tool versions (issue #321): the Node, Python and Bun versions the suite runs on.
{ file: ".tool-versions", before: "nodejs 22.5.0\n", after: "nodejs 24.1.0\n", reason: "Tool configuration changed: tool versions" },
{ file: "mise.toml", before: '[tools]\nnode = "22.5.0"\n', after: '[tools]\nnode = "24.1.0"\n', reason: "Tool configuration changed: tool versions" },
Expand Down
Loading