Skip to content
Open
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
6 changes: 6 additions & 0 deletions easybuild/tools/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def terminal_supports_colors(stream):
DEFAULT_SYS_CFGFILES = [sorted(glob.glob(os.path.join(d, 'easybuild.d', '*.cfg')))
for d in XDG_CONFIG_DIRS]
DEFAULT_USER_CFGFILE = os.path.join(XDG_CONFIG_HOME, 'easybuild', 'config.cfg')
DEFAULT_LOCAL_CFGFILE = os.path.join(os.path.normpath(os.getcwd()), 'config.cfg')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename to DEFAULT_CWD_CFGFILE, or DEFAULT_CURRENT_WORKING_DIR_CFGFILE if that's not clear enough?
I think "local" could be interpreted differently


DEFAULT_LIST_PR_STATE = GITHUB_PR_STATE_OPEN
DEFAULT_LIST_PR_ORDER = GITHUB_PR_ORDER_CREATED
Expand Down Expand Up @@ -231,6 +232,9 @@ class EasyBuildOptions(GeneralOption):
if os.path.exists(DEFAULT_USER_CFGFILE):
DEFAULT_CONFIGFILES.append(DEFAULT_USER_CFGFILE)

if os.path.exists(DEFAULT_LOCAL_CFGFILE):
DEFAULT_CONFIGFILES.append(DEFAULT_LOCAL_CFGFILE)

ALLOPTSMANDATORY = False # allow more than one argument
CONFIGFILES_RAISE_MISSING = True # don't allow non-existing config files to be specified

Expand Down Expand Up @@ -1496,6 +1500,8 @@ def show_default_configfiles(self):
'',
"[with $XDG_CONFIG_HOME: %s, $XDG_CONFIG_DIRS: %s]" % (xdg_config_home, xdg_config_dirs),
'',
"* local-level: %s" % os.path.join('.', 'config.cfg'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change this to avoid confusion:

Suggested change
"* local-level: %s" % os.path.join('.', 'config.cfg'),
"* current working directory: %s" % os.path.join('.', 'config.cfg'),

" -> %s => %s" % (DEFAULT_LOCAL_CFGFILE, ('not found', 'found')[os.path.exists(DEFAULT_LOCAL_CFGFILE)]),
"* user-level: %s" % os.path.join('${XDG_CONFIG_HOME:-$HOME/.config}', 'easybuild', 'config.cfg'),
" -> %s => %s" % (DEFAULT_USER_CFGFILE, ('not found', 'found')[os.path.exists(DEFAULT_USER_CFGFILE)]),
"* system-level: %s" % os.path.join('${XDG_CONFIG_DIRS:-/etc/xdg}', 'easybuild.d', '*.cfg'),
Expand Down