diff options
author | Juan J. MartÃnez <jjm@usebox.net> | 2022-02-16 07:33:56 +0000 |
---|---|---|
committer | Juan J. MartÃnez <jjm@usebox.net> | 2022-02-16 07:33:56 +0000 |
commit | b81f983e882ae947cc23f0bd074af36dca93f57e (patch) | |
tree | 2d17ccb4bad3c551208c46679134275fdfe5a0e2 | |
parent | 31418a90da67a1bcd1af0a39f33e8ecc5cdd2d49 (diff) | |
download | ubox-msx-lib-b81f983e882ae947cc23f0bd074af36dca93f57e.tar.gz ubox-msx-lib-b81f983e882ae947cc23f0bd074af36dca93f57e.zip |
Add black to CI
-rw-r--r-- | .gitlab-ci.yml | 15 | ||||
-rw-r--r-- | README.md | 9 | ||||
-rwxr-xr-x | 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 @@ -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( - "<H", self.data[2:4]), (self.main_init,)) + self.assertEqual(struct.unpack("<H", self.data[2:4]), (self.main_init,)) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() |