Skip to content

Refactor how we use StyleGuides for better error recovery

username-removed-6325 requested to merge bug/74 into master

In bug 74 we discovered that there are some less than ideal problems around our use of multiprocessing. This is a first attempt at fixing 74 by using a fake StyleGuide object which proxies to the real one, and will catch and handle exceptions and then posibly retry the operation we were trying to perform in the first place.

Currently we're only implementing that logic for StyleGuide.check_files but we should be careful to implement this in other functions used in hooks and elsewhere.

Note: there may be a simpler way to fix this with a context manager that will do the right thing. That may also prove simpler to implement but that will have a much larger impact on the code-base than this.

Related to bug #74 (closed)

Merge request reports