You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While testing the CLI for PR 123, I found that if the -configuration command line argument was omitted, I got an error from a later point in the code:
linux> python -m stylist -style line_length_default check_nan_inf_mod.f90
Traceback (most recent call last):
File "/net/project/ukmo/scitools/opt_scitools/conda/deployments/default-2023_05_04/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/net/project/ukmo/scitools/opt_scitools/conda/deployments/default-2023_05_04/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/var/tmp/persistent/stylist/source/stylist/__main__.py", line 203, in <module>
main()
File "/var/tmp/persistent/stylist/source/stylist/__main__.py", line 189, in main
configuration = __configure(arguments.configuration)
File "/var/tmp/persistent/stylist/source/stylist/__main__.py", line 111, in __configure
configuration = load_configuration(project_file)
File "/var/tmp/persistent/stylist/source/stylist/configuration.py", line 53, in load_configuration
raise StylistException(message)
stylist.StylistException: Unable to find configuration file: None
linux>
If -configuration is always necessary - as seems to be the case - it would be cleaner to define it with required=True to force an error during command line argument processing.
The text was updated successfully, but these errors were encountered:
Having looked further into this, the plan was to support a hierarchy of configuration. A site configuration in /etc/, then a personal configuration in $HOME/ then a project configuration. An error would only be raised if, after loading them all in order, there was still no usable configuration.
However it is not clear to me if anyone will ever want site or personal configurations. I suspect only project configurations are useful.
While testing the CLI for PR 123, I found that if the
-configuration
command line argument was omitted, I got an error from a later point in the code:If
-configuration
is always necessary - as seems to be the case - it would be cleaner to define it withrequired=True
to force an error during command line argument processing.The text was updated successfully, but these errors were encountered: