-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve CLI handling of configuration file arguments (#131)
* Make -configuration option compulsory This updates the stylist CLI to make the -configuration compulsory. This will cause the command to fail early if the configuration is incorrect, allowing ArgumentParser to display a meaningful error message. * Check configuration exists and has a valid extension This updates the CLI to check whether the configuration file exists and whether it has a valid python extension. This allows ArgumentParser to display a meaningful error if the configuration is not valid. * Add name to list of contributors As per the guidance, I have added my name to the list of contributors. * Allow Configurations to be combined Create an overload method which shallow merges the pipes and styles attributes of a second Configuration into the current instance. This is intended to be used to allow per-site, per-user, and per-project configurations to be combined into a single entity. * Adapt configuration option and improve testing Reviewer has suggested changing the argument handling to prevent the user from having to specify an option because this is contrary to spirit of making the flag voluntary. Instead, the code checks a variety of locations before raising an exception if the configuration cannot be found. This also improves temporary directory handling in tests as recommended by the reviewer, replacing clunky custom code with a function provide pytest. * Fix type hinting of __configure() The __configure() function return value in the main script had the wrong type hinting. This changes the hinting to match None in the event of a configuration problem.
- Loading branch information
Showing
5 changed files
with
194 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters