From b81f983e882ae947cc23f0bd074af36dca93f57e Mon Sep 17 00:00:00 2001 From: "Juan J. Martínez" Date: Wed, 16 Feb 2022 07:33:56 +0000 Subject: Add black to CI --- .gitlab-ci.yml | 15 ++++++++++++++- README.md | 9 +++++++++ tests/test_rom.py | 5 ++--- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0bd0a44..03f9482 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,18 @@ image: registry.gitlab.com/reidrac/ubox-msx-lib-ci:latest -build-and-test: +stages: + - lint + - build + - test + +lint: + script: + - black --check --diff . + +build: + script: + - make game + +test: script: - make test diff --git a/README.md b/README.md index 903184b..15e9863 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,15 @@ Some advice if you want to make a successful contribution: - Get early feedback, specially when working on a large contribution - Contributions always require a pull request and a review +### Formatting + +This project uses [Black](https://github.com/psf/black) to format the Python +code, and this is checked in CI. + +Before submitting any code to review, ensure you have installed Black 22.1.0 and run: + + black . + ## Authors This was mostly written by Juan J. Martinez during the development of diff --git a/tests/test_rom.py b/tests/test_rom.py index d980dad..30e8d33 100755 --- a/tests/test_rom.py +++ b/tests/test_rom.py @@ -31,9 +31,8 @@ class TestRom(unittest.TestCase): self.assertEqual(len(self.data), self.ROM_SIZE) def test_header_main_init_address(self): - self.assertEqual(struct.unpack( - "