Skip to content

Commit

Permalink
Add VS Code linting. Set line width to 120.
Browse files Browse the repository at this point in the history
Adds requirements.txt file.
  • Loading branch information
HexDecimal committed Mar 6, 2021
1 parent 1c8963e commit b9be189
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
select = C,E,F,W,B
max-line-length = 120
extend-ignore = E203, W503
15 changes: 15 additions & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[mypy]
python_version = 3.8
warn_unused_configs = True
disallow_any_generics = True
disallow_subclassing_any = True
disallow_untyped_calls = True
disallow_incomplete_defs = True
check_untyped_defs = True
disallow_untyped_decorators = True
no_implicit_optional = True
warn_redundant_casts = True
warn_unused_ignores = True
warn_return_any = True
no_implicit_reexport = True
strict_equality = True
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: main",
"type": "python",
"request": "launch",
"module": "main"
}
]
}
17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"editor.formatOnSave": true,
"python.formatting.provider": "black",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.mypyEnabled": true,
"python.linting.flake8Enabled": true,
"python.linting.mypyArgs": [
"--strict",
"--ignore-missing-imports",
"--follow-imports=silent",
"--show-column-numbers"
],
"editor.rulers": [
120
],
}
4 changes: 1 addition & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

def main() -> None:
"""Main entrypoint."""
tileset = tcod.tileset.load_tilesheet(
"Alloy_curses_12x12.png", 16, 16, tcod.tileset.CHARMAP_CP437
)
tileset = tcod.tileset.load_tilesheet("Alloy_curses_12x12.png", 16, 16, tcod.tileset.CHARMAP_CP437)
console = tcod.console.Console(1280 // 12, 720 // 12, order="C")
with tcod.context.new(width=1280, height=720, tileset=tileset) as context:
while True:
Expand Down
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[tool.black]
line-length = 120
target-version = ['py38']

[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
line_length = 120
8 changes: 8 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tcod>=12.0.0
numpy>=1.20.1

black>=3.7.4.3
isort>=5.7.0
mypy>=0.812
flake8>=2.0.0
pylint>=2.7.2

0 comments on commit b9be189

Please sign in to comment.