Skip to content

Commit 7e94ea4

Browse files
committed
Include changes to flake8 and mypy
1 parent 719648f commit 7e94ea4

File tree

9 files changed

+300
-65
lines changed

9 files changed

+300
-65
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.DS_Store
12
.coverage
23
.vscode/\n.idea/
34
# Byte-compiled / optimized / DLL files
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[flake8]
2+
ignore = E203, E266, E501, W503
3+
max-line-length = 79
4+
enable-extensions=G
5+
#select = B,C,E,F,W,T4,T0,N8,DC,DAR,SCS
6+
import-order-style = google
7+
docstring-convention = google
8+
per-file-ignores = tests/*:DC,SCS,ANN,S101 noxfile.py:ANN,DAR101
9+
max-complexity = 10
10+
exclude =
11+
docs/
12+
.git
13+
.nox
14+
__pycache__
15+
docs/source/conf.py
16+
old
17+
build
18+
dist

{{cookiecutter.project_slug}}/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.DS_Store
12
.coverage
23
.vscode/\n.idea/
34
# Byte-compiled / optimized / DLL files

{{cookiecutter.project_slug}}/.pre-commit-config.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ repos:
2020
rev: 5.10.1
2121
hooks:
2222
- id: isort
23-
- repo: https://github.com/pre-commit/mirrors-mypy
24-
rev: v0.942
25-
hooks:
26-
- id: mypy
2723
- repo: local
2824
hooks:
2925
- id: black-formatter

{{cookiecutter.project_slug}}/LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,5 @@ the library. If this is what you want to do, use the GNU Lesser General
101101
Public License instead of this License. But first, please read
102102
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
103103
{% elif cookiecutter.license == 'Proprietary' %}
104-
Copyright (C) {% now 'local', '%Y' %} {{ cookiecutter.full_name }} all rights reserved
104+
Copyright (C) {% now 'local', '%Y' %} {{ cookiecutter.full_name }} all rights reserved.
105105
{% endif %}

{{cookiecutter.project_slug}}/poetry.lock

Lines changed: 251 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

{{cookiecutter.project_slug}}/pyproject.toml

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "{{cookiecutter.project_short_description}}"
55
authors = ["{{cookiecutter.full_name}} <{{cookiecutter.email}}>"]
66

77
[tool.poetry.dependencies]
8-
python = "^3.9"
8+
python = "^3.8"
99

1010
[tool.poetry.dev-dependencies]
1111
pytest = "7.1.1"
@@ -32,6 +32,11 @@ flake8-todos = "^0.1.5"
3232
flake8-logging-format = "^0.6.0"
3333
flake8-builtins = "^1.5.3"
3434
flake8-pytest-style = "^1.6.0"
35+
lxml = "^4.8.0"
36+
flake8-bugbear = "^22.3.23"
37+
flake8-bandit = "^3.0.0"
38+
flake8-annotations = "^2.8.0"
39+
flake8-black = "^0.3.2"
3540

3641
[build-system]
3742
requires = ["poetry-core>=1.0.0"]
@@ -71,7 +76,7 @@ exclude = '''
7176

7277
[tool.pytest.ini_options]
7378
minversion = "6.0"
74-
addopts = "--verbose --color=yes --cov=src --cov-fail-under=100 --cov-report term-missing --doctest-modules --cov-config=setup.cfg"
79+
addopts = "--verbose --color=yes --cov=src --cov-fail-under=100 --cov-report term-missing --doctest-modules --cov-config=pyproject.toml"
7580
testpaths = [
7681
"tests",
7782
"src"
@@ -80,20 +85,27 @@ python_files = ["*_test.py"]
8085
python_functions = ["test_*"]
8186
render_collapsed = true
8287

88+
[tool.coverage.report]
89+
exclude_lines = [
90+
"pragma: no cover",
91+
"def __repr__",
92+
"if self.debug:",
93+
"if settings.DEBUG",
94+
"raise AssertionError",
95+
"raise NotImplementedError",
96+
"if 0:",
97+
"if __name__ == .__main__.:"
98+
]
99+
83100
[tool.mypy]
84-
warn_return_any = false
101+
warn_return_any = true
85102
warn_unused_configs = true
86103
warn_redundant_casts = true
87-
88-
[[tool.mypy.overrides]]
89-
module = [
90-
"{{cookiecutter.package_name}}"
91-
]
92-
follow_imports = "silent"
93-
strict_optional = true
94-
warn_unused_ignores = true
95-
disallow_any_generics = true
96-
check_untyped_defs = true
97-
no_implicit_reexport = true
98104
disallow_untyped_defs = true
99-
ignore_missing_imports = true
105+
disallow_any_generics = true
106+
disallow_incomplete_defs = true
107+
no_implicit_optional = true
108+
warn_unused_ignores = true
109+
show_error_context = true
110+
error_summary = true
111+
pretty = true

{{cookiecutter.project_slug}}/setup.cfg

Lines changed: 0 additions & 32 deletions
This file was deleted.

{{cookiecutter.project_slug}}/tests/{{cookiecutter.package_name}}_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def test_divide_ok(a, b, expected):
8383
def test_divide_error(a, b, expected):
8484
"""Check if divide returns correct Exceptions for known entries.
8585
86-
Issue raised by the issue: https://github.com/test/HelloWorld/issues
86+
Issue raised by https://github.com/{{cookiecutter.github_username}}/{{cookiecutter.project_slug}}/issues/1337
8787
8888
Args:
8989
a (Real): Dividend.

0 commit comments

Comments
 (0)