diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a241410a..faf3872e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -35,18 +35,26 @@ lux/ - lux/ ``` +# Code Formatting +In order to keep our codebase clean and readible, we are using PEP8 guidelines. To help us maintain and check code style, we are using [black](https://github.com/psf/black). Simply run `black .` before commiting. Failure to do so may fail the tests run on Travis. This package should have been installed for you. + # Running the Test Suite -There is a suite of test files for ensuring that Lux is working correctly. These tests are triggered to run via [Travis CI](https://travis-ci.com/lux-org/lux) whenever there is a commit made to the lux repository. +There is a suite of test files for ensuring that Lux is working correctly. These tests are triggered to run via [Travis CI](https://travis-ci.com/lux-org/lux) whenever there is a commit made to the lux repository. You can run them locally to make sure that your changes are working and do not break any of the existing tests. -You can run them locally to make sure that your changes are working and do not break any of the existing tests: +To run all the tests, including checking for code formatting, run: ``` -python -m pytest tests/*.py +make test ``` -# Code Formatting -In order to keep our codebase clean and readible, we are using PEP8 guidelines. To help us maintain and check code style, we are using [black](https://github.com/psf/black). Simply run `black --line-length 105 .` before commiting. Failure to do so may fail the tests run on Travis. This package should have been installed for you. +To run a single test file, run: + +``` +python -m pytest tests/.py +``` + + # Submitting a Pull Request diff --git a/Makefile b/Makefile index d7ee4e14..b3cb1f08 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ init: pip install -r requirements.txt test: + black --check . python -m pytest tests/ .PHONY: init test \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..f8f8a67b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,2 @@ +[tool.black] +line-length = 105 \ No newline at end of file