Provide for better reporting to users, make for easier maintenance going forward, and allow future expandability. The following major changes were made:
1. The logging config is now defined in a way which will allow future expandability. For example, we could add additional levels of `strict` or `verbosity` (see #1756) . All log messages are fed to a single log, which has two handlers (one for strict mode and one for verbosity). All level restrictions are defined per handler so that one restriction does not interfere with another. As filters do not have a level assigned to them, the previous count filter is now a nullhandler which counts all messages is receives (restricted only by level). The previous filter still exists (as a do-nothing instance) for any third-party plugins which called it. Those plugins should remove the call going forward.
2. A new exception `mkdocs.exceptions.Abort` was added. Rather than calling `SystemExit`, we now call `Abort`, which is a custom `click` exception that aborts with a readable error message and no traceback. Where appropriate, we catch errors, log them, and then call `Abort`. This allows us to remove all error handling from the CLI code and include it where errors originate from. Of course, as previously, unanticipated errors will still generate a traceback to allow debugging.
3. Log formatting has been improved. All log messages are now hard wrapped and indented for easier reading and color is used to identify each by type. Note that colors are only used to highlight errors, warnings and debug messages. Under normal operation with no issues, the user will not see any color.
* Disable Linkchecker Test.
* Switch to unittest.mock in standard lib.
* Apply `pyupgrade --py3-plus`.
* Note: Using `builtins.open` mocks all calls to `open`, including test setup
(such as in `load_config`). Whereas, `path.to.namespace.open` only mocks
`open` in that namepsace. This all worked differently when we used `io.open`
as that wasn't a builtin to begin with.
* Add a helpful error msg for PY2 users who use non-standard install methods.
Closes#1926.
While this feels like a feature change/addition, it is addressing a regression and is therefore being treated as a bug-fix.
Note that prior to 1.0 this was handled as part of the config validation. t is now handled after config validation completes. In strict mode, warnings issued in config validation interrupt the build after config validation is complete--causing the build to not complete. Warnings issued during the build (after config validation passes) allow the build to complete and only exit with a failed return code.
Closes#1604.
This also deletes relative_path_ext.py. That file was supposed to be removed some time ago. Not sure how it managed to return.
This reimplements the CLI interface to use Click, which in turn gives us
a much easier to use interface as it provides help messages for all the
commands and individual commands.
Fixes#259