ai-push-hooks 0.1.13 → 0.1.14

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.
package/README.md CHANGED
@@ -53,12 +53,12 @@ Requirements:
53
53
  | Command | What it does |
54
54
  | --- | --- |
55
55
  | `ai-push-hooks hook <remote-name> <remote-url>` | Runs the configured pre-push workflow. |
56
- | `ai-push-hooks init --template minimal-docs` | Writes `.ai-push-hooks.toml` starter config. |
56
+ | `ai-push-hooks init --template minimal-docs` | Writes `ai-push-hooks.toml` starter config. |
57
57
  | `ai-push-hooks init --template minimal-docs --force` | Overwrites an existing config file. |
58
58
 
59
59
  ## Configuration overview
60
60
 
61
- - Config file lookup order: `.ai-push-hooks.toml`, then `ai-push-hooks.toml`.
61
+ - Config file lookup order: `ai-push-hooks.toml`, then `.ai-push-hooks.toml` (legacy).
62
62
  - If no config file is present, built-in defaults are used.
63
63
  - File values are deep-merged over defaults.
64
64
  - Prompt resolution precedence for `llm` and `apply` steps:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-push-hooks",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "Modular AI push-hook workflow runner",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -20,7 +20,7 @@
20
20
  "run.sh",
21
21
  "pyproject.toml",
22
22
  "LICENSE",
23
- ".ai-push-hooks.toml"
23
+ "ai-push-hooks.toml"
24
24
  ],
25
25
  "engines": {
26
26
  "node": ">=18"
package/pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ai-push-hooks"
7
- version = "0.1.13"
7
+ version = "0.1.14"
8
8
  description = "Modular AI push-hook workflow runner"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -27,9 +27,11 @@ def init_config(template: str, force: bool, cwd: pathlib.Path | None = None) ->
27
27
  if template != "minimal-docs":
28
28
  raise HookError("Only `minimal-docs` is supported")
29
29
  target_dir = cwd or pathlib.Path.cwd()
30
- config_path = target_dir / ".ai-push-hooks.toml"
31
- if config_path.exists() and not force:
32
- raise HookError(f"Refusing to overwrite existing config without --force: {config_path}")
30
+ config_path = target_dir / "ai-push-hooks.toml"
31
+ legacy_path = target_dir / ".ai-push-hooks.toml"
32
+ existing_path = config_path if config_path.exists() else legacy_path if legacy_path.exists() else None
33
+ if existing_path is not None and not force:
34
+ raise HookError(f"Refusing to overwrite existing config without --force: {existing_path}")
33
35
  config_path.write_text(MINIMAL_DOCS_TEMPLATE, encoding="utf-8")
34
36
  sys.stdout.write(str(config_path) + "\n")
35
37
  return 0
@@ -318,7 +318,7 @@ def _apply_env_overrides(config: HookConfig) -> HookConfig:
318
318
  def load_config(repo_root: pathlib.Path) -> tuple[HookConfig, pathlib.Path | None]:
319
319
  config_path: pathlib.Path | None = None
320
320
  raw = copy.deepcopy(DEFAULT_CONFIG_RAW)
321
- for candidate in [repo_root / ".ai-push-hooks.toml", repo_root / "ai-push-hooks.toml"]:
321
+ for candidate in [repo_root / "ai-push-hooks.toml", repo_root / ".ai-push-hooks.toml"]:
322
322
  if candidate.exists():
323
323
  config_path = candidate
324
324
  text = candidate.read_text(encoding="utf-8")
File without changes