-
-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add automatic code format enforcer - black #813
Changes from 3 commits
d9dbcee
89d8912
c4cf33a
b8ee4a7
2c68d4d
4487ddc
7474be8
8cafe90
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
sha: v1.1.1 | ||
rev: v1.2.3 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see above |
||
- id: check-yaml | ||
- id: debug-statements | ||
- id: flake8 | ||
- repo: https://github.com/ambv/black | ||
rev: stable | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You'll want to pick a specific tag: https://pre-commit.com/#using-the-latest-version-for-a-repository There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed, and yeah I agree about the quotes; but at the end of day I prefer consistency over which of the two :-) |
||
hooks: | ||
- id: black | ||
args: [--line-length=99, --safe] | ||
python_version: python3.6 | ||
- repo: https://github.com/asottile/pyupgrade | ||
sha: v1.2.0 | ||
rev: v1.2.0 | ||
hooks: | ||
- id: pyupgrade |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,9 @@ | |
.. image:: https://readthedocs.org/projects/tox/badge/?version=latest | ||
:target: http://tox.readthedocs.io/en/latest/?badge=latest | ||
:alt: Documentation status | ||
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg | ||
:target: https://github.com/ambv/black | ||
:alt: Code style: black | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I guess that is the case now :) |
||
|
||
tox automation project | ||
====================== | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,66 +17,65 @@ def has_environment_marker_support(): | |
* https://www.python.org/dev/peps/pep-0426/#environment-markers | ||
""" | ||
import pkg_resources | ||
|
||
try: | ||
v = pkg_resources.parse_version(setuptools.__version__) | ||
return v >= pkg_resources.parse_version('0.7.2') | ||
return v >= pkg_resources.parse_version("0.7.2") | ||
except Exception as e: | ||
sys.stderr.write("Could not test setuptool's version: %s\n" % e) | ||
sys.stderr.write("Could not test setuptool's version: {}\n".format(e)) | ||
return False | ||
|
||
|
||
def get_long_description(): | ||
with io.open('README.rst', encoding='utf-8') as f: | ||
with io.open('CHANGELOG.rst', encoding='utf-8') as g: | ||
return "%s\n\n%s" % (f.read(), g.read()) | ||
with io.open("README.rst", encoding="utf-8") as f: | ||
with io.open("CHANGELOG.rst", encoding="utf-8") as g: | ||
return "{}\n\n{}".format(f.read(), g.read()) | ||
|
||
|
||
def main(): | ||
setuptools.setup( | ||
name='tox', | ||
description='virtualenv-based automation of test activities', | ||
name="tox", | ||
description="virtualenv-based automation of test activities", | ||
long_description=get_long_description(), | ||
url='https://tox.readthedocs.org/', | ||
url="https://tox.readthedocs.org/", | ||
use_scm_version=True, | ||
license='http://opensource.org/licenses/MIT', | ||
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], | ||
author='holger krekel', | ||
author_email='[email protected]', | ||
packages=['tox'], | ||
entry_points={'console_scripts': ['tox=tox:cmdline', | ||
'tox-quickstart=tox._quickstart:main']}, | ||
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', | ||
setup_requires=['setuptools_scm'], | ||
install_requires=['py>=1.4.17', | ||
'pluggy>=0.3.0,<1.0', | ||
'six', | ||
'virtualenv>=1.11.2'], | ||
extras_require={'testing': ['pytest >= 3.0.0', | ||
'pytest-cov', | ||
'pytest-mock', | ||
'pytest-timeout', | ||
'pytest-xdist'], | ||
'docs': ['sphinx >= 1.6.3, < 2', | ||
'towncrier >= 17.8.0'], | ||
'lint': ['flake8 == 3.4.1', | ||
'flake8-bugbear == 17.4.0', | ||
'pre-commit == 1.4.4'], | ||
'publish': ['devpi', | ||
'twine']}, | ||
classifiers=['Development Status :: 5 - Production/Stable', | ||
'Framework :: tox', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: MIT License', | ||
'Operating System :: POSIX', | ||
'Operating System :: Microsoft :: Windows', | ||
'Operating System :: MacOS :: MacOS X', | ||
'Topic :: Software Development :: Testing', | ||
'Topic :: Software Development :: Libraries', | ||
'Topic :: Utilities'] + [ | ||
('Programming Language :: Python :: {}'.format(x)) for | ||
x in '2 2.7 3 3.4 3.5 3.6'.split()] | ||
license="http://opensource.org/licenses/MIT", | ||
platforms=["unix", "linux", "osx", "cygwin", "win32"], | ||
author="holger krekel", | ||
author_email="[email protected]", | ||
packages=["tox"], | ||
entry_points={ | ||
"console_scripts": ["tox=tox:cmdline", "tox-quickstart=tox._quickstart:main"] | ||
}, | ||
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", | ||
setup_requires=["setuptools_scm"], | ||
install_requires=["py>=1.4.17", "pluggy>=0.3.0,<1.0", "six", "virtualenv>=1.11.2"], | ||
extras_require={ | ||
"testing": [ | ||
"pytest >= 3.0.0", "pytest-cov", "pytest-mock", "pytest-timeout", "pytest-xdist" | ||
], | ||
"docs": ["sphinx >= 1.6.3, < 2", "towncrier >= 17.8.0"], | ||
"lint": ["flake8 == 3.5.0", "flake8-bugbear == 18.2.0", "pre-commit == 1.8.2"], | ||
"publish": ["devpi", "twine"], | ||
}, | ||
classifiers=[ | ||
"Development Status :: 5 - Production/Stable", | ||
"Framework :: tox", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: POSIX", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: MacOS :: MacOS X", | ||
"Topic :: Software Development :: Testing", | ||
"Topic :: Software Development :: Libraries", | ||
"Topic :: Utilities", | ||
] | ||
+ [ | ||
("Programming Language :: Python :: {}".format(x)) | ||
for x in "2 2.7 3 3.4 3.5 3.6".split() | ||
], | ||
) | ||
|
||
|
||
if __name__ == '__main__': | ||
if __name__ == "__main__": | ||
main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary with black anymore, I guess.