There are several things that can go wrong when trying to run the CLI from an IDE. All of these are really hard to debug at the moment:
- CLI might not be able to figure out where the Git root is
- CLI might not be able to find its config file
In these cases, ATM we log unhelpful error messages like
No valid config found
Or
Invalid path to file in repository: None
These don't give any clue to the user as to what they misconfigured. This makes setting up the CLI a trial-and-error game where you move around files and change command line settings like a crazy person for 20 minutes until you find the right combination by accident.
Instead I'd like to do the following:
When the config file can't be found, log all paths where the CLI tried to search for one.
When the git repo root can't be found, log every folder that was checked and why it wasn't considered as a git root.
In both cases, please provide clear instructions how the user can fix the problem. E.g:
Please place the .teamscale-precommit.config file in the folder XYZ
Or
None of the following paths seem to contain a git repository:
/A/B/C
/A/B
/A
Please make sure the path you provided on the command line points to a file or folder inside the git repository.
We should in addition go through the other error handling in the plugin and make sure any other errors have helpful error messages.