forked from hasgeek/funnel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
214 lines (198 loc) · 5.74 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# Default tool config file. See also setup.cfg for tools that don't yet
# support pyproject.toml.
[tool.black]
line-length = 88
target_version = ['py37']
skip-string-normalization = true
include = '\.pyi?$'
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| __pycache__
| buck-out
| build
| dist
| node_modules
| funnel/assets
)/
'''
[tool.djlint]
profile='jinja'
extension='.html.jinja2'
indent=2
ignore="T002,T028,H006,H016,H020,H023,H030,H031"
[tool.curlylint]
# Curlylint is not used, but the configuration is preserved here for future use
include = '\.html.jinja2$'
template_tags = [['set'], ['trans', 'pluralize', 'endtrans']]
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| __pycache__
| buck-out
| build
| dist
| node_modules
| funnel/assets
)/
'''
[tool.curlylint.rules]
# All role attributes must be valid.
# See https://www.curlylint.org/docs/rules/aria_role
aria_role = true
# HTML lang attribute must be set
# See https://www.curlylint.org/docs/rules/html_has_lang
html_has_lang = true
# The `alt` attribute must be present.
# See https://www.curlylint.org/docs/rules/image_alt
image_alt = true
# Indent 2 spaces
# See https://www.curlylint.org/docs/rules/indent
# Enable after issue 6 is fixed: https://github.com/thibaudcolas/curlylint/issues/6
# indent = 2
# Avoid positive `tabindex` values
tabindex_no_positive = true
[tool.isort]
profile = 'black'
multi_line_output = 3
include_trailing_comma = true
line_length = 88
order_by_type = true
use_parentheses = true
from_first = true
# add_imports = 'from __future__ import annotations'
known_future_library = ['__future__', 'six']
known_first_party = ['baseframe', 'coaster', 'funnel']
known_sqlalchemy = ['alembic', 'sqlalchemy', 'sqlalchemy_utils', 'flask_sqlalchemy', 'psycopg2', 'sqlalchemy_json']
known_flask = [
'flask',
'click',
'werkzeug',
'itsdangerous',
'wtforms',
'webassets',
'flask_assets',
'flask_babel',
'flask_executor',
'flask_flatpages',
'flask_mailman',
'flask_migrate',
'flask_redis',
'flask_rq2',
]
default_section = 'THIRDPARTY'
sections = ['FUTURE', 'STDLIB', 'SQLALCHEMY', 'FLASK', 'THIRDPARTY', 'FIRSTPARTY', 'LOCALFOLDER']
[tool.pytest.ini_options]
minversion = "6.1" # For config.rootpath
required_plugins = [
'pytest-bdd',
'pytest-cov',
'pytest-dotenv',
'pytest-env',
'pytest-remotedata',
'pytest-rerunfailures',
'pytest-splinter',
'requests-mock',
]
addopts = [
'--cov-report=term-missing',
'--splinter-screenshot-dir=tests/screenshots',
'--remote-data=any',
'--strict-markers',
'--splinter-headless'
]
markers = [
'dbcommit: Test requires true database commits',
'formdata(dict): HTTP form data for form fixture',
'formuser("user"): User fixture for editing a form',
'update_markdown_data: Regenerate markdown test output (dev use only)',
'debug_markdown_output: Generate markdown debug file tests/data/markdown/output.html (dev use only)',
'requires_config("feature"): Run test only if specified app config is available'
]
filterwarnings = ['ignore::DeprecationWarning', 'ignore::UserWarning']
remote_data_strict = true
env = [
'FLASK_ENV=testing',
# For macOS: https://stackoverflow.com/a/52230415/78903
'OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES',
'D:HOSTALIASES={PWD}/HOSTALIASES'
]
env_override_existing_values = false
env_files = ['.env', '.env.testing']
[tool.pyright]
venv = 'hasgeek'
reportMissingImports = true
reportMissingTypeStubs = false
reportShadowedImports = false
pythonVersion = '3.7'
[tool.mypy]
files = '**/*.py'
exclude = 'node_modules'
ignore_missing_imports = true
show_error_codes = true
warn_unreachable = true
warn_unused_ignores = true
warn_redundant_casts = false
check_untyped_defs = false
[[tool.mypy.overrides]]
# This override doesn't seem to work
module = ['tests']
check_untyped_defs = true
warn_unreachable = false
[[tool.mypy.overrides]]
module = ['flask_sqlalchemy']
follow_imports = 'skip'
[tool.pylint.master]
load-plugins = ['pylint_pytest']
max-parents = 10
init-hook = """
import os, astroid.bases, pathlib
# Tell Pylint where to find packages from within tests
for path in pathlib.Path.cwd().parents:
if (path / 'pyproject.toml').is_file():
sys.path.append(str(path))
# Tell Pylint hybrid_property and cached_property are property-types
astroid.bases.POSSIBLE_PROPERTIES.add('hybrid_property')
astroid.bases.POSSIBLE_PROPERTIES.add('cached_property')
"""
[tool.pylint.message_control]
max-line-length = 88
disable = [
'comparison-with-callable', # Pylint is confused by SQLAlchemy attributes
'cyclic-import', # We have tail imports all over
'duplicate-code', # Too many false positives
'fixme', # Our workflow is to tag for future fixes
'invalid-name', # Flake8 covers our naming convention requirements
'no-member', # Pylint gets confused over how some members become part of an instance
'too-few-public-methods', # Data classes and validator classes have few methods
'too-many-ancestors', # Our models have a large number of mixin classes
'too-many-instance-attributes', # Some instances are just bags of attributes
'too-many-lines', # We have large files that include all related functionality
'too-many-public-methods', # Models and views have many public methods
'unused-argument', # Arguments required for spec compatibility aren't always used
'wrong-import-position', # Let black and isort handle this
# Temporarily disabled pending audit and fixes
'missing-class-docstring',
'missing-function-docstring',
'too-many-branches',
'too-many-nested-blocks',
'too-many-return-statements',
'too-many-statements',
'too-many-locals',
]
[tool.bandit]
exclude_dirs = ['node_modules']
[tool.bandit.assert_used]
skips = ['*/*_test.py', '*/test_*.py', '*/conftest.py']