diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..db2c7e1a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +# http://editorconfig.org + +root = true + +[*] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true +insert_final_newline = true +charset = utf-8 +end_of_line = lf + +[*.{yaml,yml}] +indent_style = space +indent_size = 2 diff --git a/.gitignore b/.gitignore index 8e74f0bc..78b51a3a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,122 @@ -# Byte-compiled files -*.pyc +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class -# Packaging -*.egg +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ *.egg-info/ -*.eggs -build -dist -shivs/ +.installed.cfg +*.egg +MANIFEST -# Unit test -.cache/ +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ .tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# Visual Studio Code +.vscode # auto-generated version file Lib/fontmake/_version.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..dcdf0949 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,27 @@ +repos: +- repo: https://github.com/ambv/black + rev: 18.9b0 + hooks: + - id: black + language_version: python3 +- repo: https://github.com/asottile/blacken-docs + rev: v0.3.0 + hooks: + - id: blacken-docs + additional_dependencies: [black==18.9b0] +- repo: https://github.com/asottile/pyupgrade + rev: v1.11.1 + hooks: + - id: pyupgrade +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.1.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-ast + - id: mixed-line-ending + args: ["--fix=lf"] + - id: debug-statements + - id: flake8 + additional_dependencies: [flake8-bugbear] diff --git a/.travis.yml b/.travis.yml index dbb37818..640143f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,11 +9,17 @@ python: - "2.7" - "3.6" +cache: + directories: + - $HOME/.cache/pip + - $HOME/.cache/pre-commit + install: - pip install --upgrade pip - - pip install -r test_requirements.txt . + - pip install pre-commit -r test_requirements.txt . script: + - pre-commit run --all-files --show-diff-on-failure - (cd test && ./run.sh) after_success: