Skip to content

Commit

Permalink
Allow asv.conf.jsonc file by default
Browse files Browse the repository at this point in the history
  • Loading branch information
lucascolley committed Aug 6, 2024
1 parent ee3b187 commit c17b79a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions asv/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c17b79a

Please sign in to comment.