Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to code formatter Black: Travis integration
This adds a new job for running `black` to our Travis CI continuous integration configuration. See the previous commits for more details on Black. If `black` finds a problem with the formatting, its job will be marked as "Failed". A diff of the required changes can be found on Travis CI by clicking on job `black` and scrolling down the Job log. You may also run `black` on your local machine to let it make the corrections for you. The new job is added to the default stage (`test`), meaning it will run alongside the regular test suite jobs. `black` is kept separate from the test suite, because it only needs to run once, not on multiple Python versions and architectures. A failure reported by `black` will not stop the test suite jobs from running, but will result in the build as a whole to be marked "Failed" in the end, even if the other jobs all passed. Using a separate Travis CI "stage" (named `lint`) was attempted, but considered inadequate: - Running stage `lint` *after* stage `test` meant long waiting for what was actually the fastest job. - Running stage `lint` *before* stage `test` meant a minor formatting issue could prevent the test suite from running at all. - Defining stage `lint` as an `allowed_failure` meant its outcome would become irrelevant for the outcome of the build as a whole, i.e. the build would pass even if `lint` had failed.
- Loading branch information