From 43a70c15e01428900f267ecf0a0797a522bf1d21 Mon Sep 17 00:00:00 2001 From: jinimukh <46768380+jinimukh@users.noreply.github.com> Date: Sun, 29 Nov 2020 05:36:46 -0800 Subject: [PATCH] Update Makefile and pyproject.toml (#160) * add black to travis * reformat all code and adjust test * remove .idea * fix contributing doc * small change in contributing * update * reformat, update command to fix version * remove dev dependencies * first pass -- inline comments * _config/config.py * delete test notebook * action * line length 105 * executor * interestingness * processor * vislib * tests, travis, CONTRIBUTING * .format () changed * replace tabs with escape chars * update using black * more rewrites and merges into single line * update pyproject.toml and makefile * updating contributing doc * Update CONTRIBUTING.md Co-authored-by: Doris Lee --- CONTRIBUTING.md | 18 +++++++++++++----- Makefile | 1 + pyproject.toml | 2 ++ 3 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 pyproject.toml 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