Skip to content

Commit

Permalink
Configure code formatting using black
Browse files Browse the repository at this point in the history
"E203 whitespace before ':'" ignored from now on, becuase [1] and [2].

[1] psf/black#544
[2] https://github.com/ambv/black#slices
  • Loading branch information
jstasiak committed Feb 10, 2019
1 parent 166dad0 commit 90ee58d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.PHONY: lint
lint: flake8 mypy
lint: flake8 mypy check-format

.PHONY: flake8
flake8:
Expand All @@ -20,3 +20,13 @@ test:

.PHONY: ci
ci: test lint


.PHONY: format
format:
black .


.PHONY: check-format
check-format:
black --check .
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[tool.black]
line-length = 110
py36 = true
skip_string_normalization = true
exclude = 'clang/'
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
14 changes: 4 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']},
)

0 comments on commit 90ee58d

Please sign in to comment.