commit 044effc41b73881b30aab94e9df05aea0771202c
parent 9219c6c171d802317d2b8e9db1c14b7f3e18c291
Author: andrewlaack-collab <andrew.laack@imbue.com>
Date: Thu, 12 Feb 2026 05:31:38 +0000
Refactoring config locations / names (#66)
Diffstat:
8 files changed, 30 insertions(+), 24 deletions(-)
diff --git a/vet.toml b/.vet/configs.toml
diff --git a/models.json b/.vet/models.json
diff --git a/README.md b/README.md
@@ -145,7 +145,7 @@ Output formats:
Vet supports custom model definitions using OpenAI-compatible endpoints via JSON config files searched in:
- `$XDG_CONFIG_HOME/vet/models.json` (or `~/.config/vet/models.json`)
-- `models.json` at your repo root
+- `.vet/models.json` at your repo root
#### Example `models.json`
@@ -191,14 +191,14 @@ Vet supports named profiles so teams can standardize CI usage without long CLI i
Profiles set defaults like model choice, enabled issue codes, output format, and thresholds.
-See [the example](https://github.com/imbue-ai/vet/blob/main/vet.toml) in this project.
+See [the example](https://github.com/imbue-ai/vet/blob/main/.vet/configs.toml) in this project.
### Custom issue guides
You can customize the guide text for the issue codes via `guides.toml`. Guide files are loaded from:
- `$XDG_CONFIG_HOME/vet/guides.toml` (or `~/.config/vet/guides.toml`)
-- `guides.toml` at your repo root
+- `.vet/guides.toml` at your repo root
#### Example `guides.toml`
diff --git a/vet/cli/config/cli_config_test.py b/vet/cli/config/cli_config_test.py
@@ -152,7 +152,7 @@ def test_get_cli_config_file_paths_returns_global_path(tmp_path: Path) -> None:
paths = get_cli_config_file_paths(repo_path=None)
assert len(paths) == 1
- assert paths[0] == tmp_path / "vet" / "config.toml"
+ assert paths[0] == tmp_path / "vet" / "configs.toml"
def test_get_cli_config_file_paths_includes_project_path(tmp_path: Path) -> None:
@@ -163,8 +163,8 @@ def test_get_cli_config_file_paths_includes_project_path(tmp_path: Path) -> None
paths = get_cli_config_file_paths(repo_path=repo_path)
assert len(paths) == 2
- assert paths[0] == tmp_path / "xdg" / "vet" / "config.toml"
- assert paths[1] == repo_path / "vet.toml"
+ assert paths[0] == tmp_path / "xdg" / "vet" / "configs.toml"
+ assert paths[1] == repo_path / ".vet" / "configs.toml"
def test_get_cli_config_file_paths_finds_git_root(tmp_path: Path) -> None:
@@ -177,11 +177,11 @@ def test_get_cli_config_file_paths_finds_git_root(tmp_path: Path) -> None:
with patch.dict(os.environ, {"XDG_CONFIG_HOME": str(tmp_path / "xdg")}):
paths = get_cli_config_file_paths(repo_path=subdir)
- assert paths[1] == git_root / "vet.toml"
+ assert paths[1] == git_root / ".vet" / "configs.toml"
def test_load_cli_config_file_loads_valid_toml(tmp_path: Path) -> None:
- config_file = tmp_path / "config.toml"
+ config_file = tmp_path / "configs.toml"
config_file.write_text(
"""
[ci]
@@ -206,7 +206,7 @@ model = "claude-4-sonnet"
def test_load_cli_config_file_raises_on_invalid_toml(tmp_path: Path) -> None:
- config_file = tmp_path / "config.toml"
+ config_file = tmp_path / "configs.toml"
config_file.write_text("not = valid = toml")
with pytest.raises(ConfigLoadError) as exc_info:
@@ -216,7 +216,7 @@ def test_load_cli_config_file_raises_on_invalid_toml(tmp_path: Path) -> None:
def test_load_cli_config_file_raises_on_invalid_schema(tmp_path: Path) -> None:
- config_file = tmp_path / "config.toml"
+ config_file = tmp_path / "configs.toml"
config_file.write_text(
"""
[ci]
@@ -231,7 +231,7 @@ confidence_threshold = "not-a-float"
def test_load_cli_config_file_raises_on_unknown_field(tmp_path: Path) -> None:
- config_file = tmp_path / "config.toml"
+ config_file = tmp_path / "configs.toml"
config_file.write_text(
"""
[ci]
@@ -255,7 +255,9 @@ def test_load_cli_config_returns_empty_when_no_files_exist(tmp_path: Path) -> No
def test_load_cli_config_loads_single_file(tmp_path: Path) -> None:
repo_path = tmp_path / "repo"
repo_path.mkdir()
- config_file = repo_path / "vet.toml"
+ vet_dir = repo_path / ".vet"
+ vet_dir.mkdir()
+ config_file = vet_dir / "configs.toml"
config_file.write_text(
"""
[ci]
@@ -273,7 +275,7 @@ confidence_threshold = 0.9
def test_load_cli_config_merges_global_and_project(tmp_path: Path) -> None:
xdg_config = tmp_path / "xdg"
(xdg_config / "vet").mkdir(parents=True)
- global_config = xdg_config / "vet" / "config.toml"
+ global_config = xdg_config / "vet" / "configs.toml"
global_config.write_text(
"""
[ci]
@@ -287,7 +289,8 @@ model = "global-model"
repo_path = tmp_path / "repo"
repo_path.mkdir()
- project_config = repo_path / "vet.toml"
+ (repo_path / ".vet").mkdir()
+ project_config = repo_path / ".vet" / "configs.toml"
project_config.write_text(
"""
[ci]
@@ -349,8 +352,8 @@ def test_get_config_preset_raises_on_unknown_with_no_configs(tmp_path: Path) ->
assert "unknown" in error_msg
assert "No configuration files found" in error_msg
# Verify the error message contains dynamically generated paths with labels
- assert f"{tmp_path / 'xdg' / 'vet' / 'config.toml'} (global)" in error_msg
- assert f"{repo_path / 'vet.toml'} (project)" in error_msg
+ assert f"{tmp_path / 'xdg' / 'vet' / 'configs.toml'} (global)" in error_msg
+ assert f"{repo_path / '.vet' / 'configs.toml'} (project)" in error_msg
def _create_default_args() -> argparse.Namespace:
diff --git a/vet/cli/config/custom_guides_loader_test.py b/vet/cli/config/custom_guides_loader_test.py
@@ -118,7 +118,7 @@ suffix = "- Global suffix"
repo_path = tmp_path / "repo"
repo_path.mkdir()
_write_guides_toml(
- repo_path / "guides.toml",
+ repo_path / ".vet" / "guides.toml",
"""
[logic_error]
prefix = "- Project prefix"
@@ -147,7 +147,7 @@ suffix = "- Global logic error suffix"
repo_path = tmp_path / "repo"
repo_path.mkdir()
_write_guides_toml(
- repo_path / "guides.toml",
+ repo_path / ".vet" / "guides.toml",
"""
[insecure_code]
replace = "- Project insecure code replacement"
diff --git a/vet/cli/config/loader.py b/vet/cli/config/loader.py
@@ -63,7 +63,7 @@ def _get_config_file_paths(
if repo_path:
git_root = find_git_repo_root(repo_path)
root = git_root if git_root else repo_path
- paths.append(root / project_filename)
+ paths.append(root / ".vet" / project_filename)
return paths
@@ -163,7 +163,7 @@ def build_language_model_config(model_id: str, user_config: ModelsConfig) -> Lan
def get_cli_config_file_paths(repo_path: Path | None = None) -> list[Path]:
- return _get_config_file_paths("vet", "config.toml", "vet.toml", repo_path)
+ return _get_config_file_paths("vet", "configs.toml", "configs.toml", repo_path)
def _load_cli_config_file(config_path: Path) -> dict[str, CliConfigPreset]:
diff --git a/vet/cli/config/loader_test.py b/vet/cli/config/loader_test.py
@@ -73,7 +73,7 @@ def test_get_config_file_paths_finds_git_root(tmp_path: Path) -> None:
paths = get_config_file_paths(repo_path=subdir)
assert len(paths) == 2
assert paths[0] == xdg_config / "vet" / "models.json"
- assert paths[1] == git_root / "models.json"
+ assert paths[1] == git_root / ".vet" / "models.json"
def test_load_single_config_file_loads_valid_config(tmp_path: Path) -> None:
@@ -162,7 +162,9 @@ def test_load_models_config_returns_empty_when_no_files_exist(tmp_path: Path) ->
def test_load_models_config_loads_project_config(tmp_path: Path) -> None:
repo_path = tmp_path / "repo"
repo_path.mkdir()
- config_file = repo_path / "models.json"
+ vet_dir = repo_path / ".vet"
+ vet_dir.mkdir()
+ config_file = vet_dir / "models.json"
config_data = {
"providers": {
"project-provider": {
@@ -211,7 +213,8 @@ def test_load_models_config_project_overrides_global(tmp_path: Path) -> None:
repo_path = tmp_path / "repo"
repo_path.mkdir()
- project_config = repo_path / "models.json"
+ (repo_path / ".vet").mkdir()
+ project_config = repo_path / ".vet" / "models.json"
project_config.write_text(
json.dumps(
{
diff --git a/vet/cli/main.py b/vet/cli/main.py
@@ -86,7 +86,7 @@ def create_parser() -> argparse.ArgumentParser:
type=str,
default=None,
metavar="NAME",
- help="Name of the configuration to use. Configurations are defined in vet.toml in your target project's root or ~/.config/vet/config.toml.",
+ help="Name of the configuration to use. Configurations are defined in .vet/configs.toml in your target project's root or ~/.config/vet/configs.toml.",
)
parser.add_argument(
"--list-configs",