Refactor main executable into a frontend architecture. #178
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Instead of a bunch of free functions that pass their arguments
around, this change now refactors the core format and lint file
handling functionality into a set of "frontend" classes so that
the diagnostic engine and related state can be created in one
place and shared.
This also significantly improves error handling. Whereas we
were previously killing the process on the first sign of a
source file or configuration file being invalid, we now emit
an error and skip the file, allowing any remaining inputs to
still be processed.
Lastly, this introduces a configuration cache so that we're
not re-reading the configuration from the file system for
every source file we process. In most cases, when we're
processing a recursive directory structure, they'll all
share a configuration file at a common root, so we cache
that based on its file URL and return it when requested.