Skip to content

Commit

Permalink
add black to travis (#127)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jinimukh committed Nov 2, 2020
1 parent 6a20c47 commit f986c76
Show file tree
Hide file tree
Showing 70 changed files with 6,253 additions and 4,476 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ install:
- pip install git+https://github.com/lux-org/lux-widget
# command to run tests
script:
- black --target-version py37 --check .
- python -m pytest tests/*.py
- pytest --cov-report term --cov=lux tests/
after_success:
Expand Down
5 changes: 4 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ You can run them locally to make sure that your changes are working and do not b
python -m pytest tests/*.py
```

# 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.

# Submitting a Pull Request

You can commit your code and push to your forked repo. Once all of your local changes have been tested and is working, you are ready to submit a PR. For Lux, we use the "Squash and Merge" strategy to merge in PR, which means that even if you make a lot of small commits in your PR, they will all get squashed into a single commit associated with the PR. Please make sure that comments and unnecessary file changes are not committed as part of the PR by looking at the "File Changes" diff view on the pull request page.
You can commit your code and push to your forked repo. Once all of your local changes have been tested and formatted, you are ready to submit a PR. For Lux, we use the "Squash and Merge" strategy to merge in PR, which means that even if you make a lot of small commits in your PR, they will all get squashed into a single commit associated with the PR. Please make sure that comments and unnecessary file changes are not committed as part of the PR by looking at the "File Changes" diff view on the pull request page.

Once the pull request is submitted, the maintainer will get notified and review your pull request. They may ask for additional changes or comment on the PR. You can always make updates to your pull request after submitting it.

Expand Down
50 changes: 26 additions & 24 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright 2019-2020 The Lux Authors.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand All @@ -19,7 +19,8 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import subprocess
subprocess.call(['sh', './docbuild.sh'])

subprocess.call(["sh", "./docbuild.sh"])
# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
Expand All @@ -28,18 +29,19 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('..'))

sys.path.insert(0, os.path.abspath(".."))
sys.path.insert(0, os.path.abspath(".."))


# -- Project information -----------------------------------------------------

project = 'Lux'
copyright = '2020, Doris Jung-Lin Lee'
author = 'Doris Jung-Lin Lee'
project = "Lux"
copyright = "2020, Doris Jung-Lin Lee"
author = "Doris Jung-Lin Lee"

# The full version, including alpha/beta/rc tags
release = '0.1.2'
release = "0.1.2"


# -- General configuration ---------------------------------------------------
Expand All @@ -48,32 +50,32 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
'sphinx.ext.autosummary',
'sphinx.ext.doctest',
'sphinx.ext.githubpages',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
'sphinx.ext.mathjax',
'sphinx_automodapi.automodapi',
'sphinx_automodapi.automodsumm'
"sphinx.ext.autodoc",
"sphinx.ext.coverage",
"sphinx.ext.autosummary",
"sphinx.ext.doctest",
"sphinx.ext.githubpages",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"sphinx.ext.mathjax",
"sphinx_automodapi.automodapi",
"sphinx_automodapi.automodsumm",
]

autodoc_default_flags = ['members', "inherited-members"]
autodoc_default_flags = ["members", "inherited-members"]
autodoc_member_order = "groupwise"
autosummary_generate = True
numpydoc_show_class_members = False


# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]


# -- Options for HTML output -------------------------------------------------
Expand All @@ -88,7 +90,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]
html_logo = "_static/logo.png"

html_theme_options = {"style_nav_header_background": "#19177c"}
Expand All @@ -97,4 +99,4 @@
# further. For a list of options available for each theme, see the
# documentation.
#
master_doc = 'index'
master_doc = "index"
2 changes: 1 addition & 1 deletion lux/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright 2019-2020 The Lux Authors.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
Loading

0 comments on commit f986c76

Please sign in to comment.