From c17b79a81cbe33cbd8454c27274a39b01df86423 Mon Sep 17 00:00:00 2001 From: Lucas Colley Date: Tue, 6 Aug 2024 11:32:28 +0000 Subject: [PATCH] Allow `asv.conf.jsonc` file by default --- asv/config.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/asv/config.py b/asv/config.py index a13edcb19..802747369 100644 --- a/asv/config.py +++ b/asv/config.py @@ -48,13 +48,16 @@ def __init__(self): def load(cls, path=None): """ Load a configuration from a file. If no file is provided, - defaults to `asv.conf.json`. + defaults to `asv.conf.json` (also checks for `asv.conf.jsonc`). """ if not path: path = "asv.conf.json" if not os.path.isfile(path): - raise util.UserError(f"Config file {path} not found.") + # also check for `asv.conf.jsonc` (JSON with comments) + path += 'c' + if not os.path.isfile(path): + raise util.UserError(f"Config file {path} not found.") d = util.load_json(path, cls.api_version, js_comments=True) try: