diff --git a/Makefile b/Makefile index 375b092..499d097 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ .PHONY: lint -lint: flake8 mypy +lint: flake8 mypy check-format .PHONY: flake8 flake8: @@ -20,3 +20,13 @@ test: .PHONY: ci ci: test lint + + +.PHONY: format +format: + black . + + +.PHONY: check-format +check-format: + black --check . diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..6162c96 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,5 @@ +[tool.black] +line-length = 110 +py36 = true +skip_string_normalization = true +exclude = 'clang/' diff --git a/setup.cfg b/setup.cfg index 40bf515..1992cfa 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,7 +5,7 @@ application-import-names = kotlang # TODO go down to 105-110 max-line-length = 115 # Ignoring F821 because we use unquoted forward declarations in type hints (PEP 563) -ignore = E701,F401,F821,W503 +ignore = E203,E701,F401,F821,W503 exclude = kotlang/clang [tool:pytest] diff --git a/setup.py b/setup.py index 215dea9..309c381 100644 --- a/setup.py +++ b/setup.py @@ -6,23 +6,17 @@ name='kotlang', license='MIT', packages=['kotlang'], - install_requires=[ - 'llvmlite>=0.23.2', - 'click', - ], + install_requires=['llvmlite>=0.23.2', 'click'], extras_require={ 'dev': [ + 'black', 'flake8', 'flake8-import-order', # We need to avoid 0.650 because of https://github.com/python/mypy/pull/6097 'mypy>=0.620,!=0.650', 'pytest', 'pytest-cov', - ], - }, - entry_points={ - 'console_scripts': [ - 'kotc = kotlang.kotc_main:main', - ], + ] }, + entry_points={'console_scripts': ['kotc = kotlang.kotc_main:main']}, )