-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
141 lines (134 loc) · 3.74 KB
/
pyproject.toml
File metadata and controls
141 lines (134 loc) · 3.74 KB
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
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "openwatch"
version = "0.1.0a1"
description = "OpenWatch Compliance Scanner"
dependencies = []
[tool.pytest.ini_options]
minversion = "6.0"
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
"--cov=app",
"--cov-report=term-missing",
"--cov-report=html:coverage_html",
"--cov-report=xml:coverage.xml",
"--cov-fail-under=42",
"--tb=short",
]
testpaths = ["validation/scenarios"]
python_files = ["*_validation.py", "*_scenarios.py"]
python_classes = ["Test*"]
python_functions = ["test_*", "validate_*"]
markers = [
"unit: Unit tests for individual components",
"integration: Integration tests for component interactions",
"performance: Performance and load tests",
"security: Security and compliance validation tests",
"scap: SCAP scanning and processing tests",
"ssh: SSH credential and connection tests",
"database: Database operation tests",
"api: API endpoint tests",
"auth: Authentication and authorization tests",
"compliance: Compliance framework tests",
"slow: Slower running tests (exclude with -m 'not slow')",
"requires_openscap: Tests requiring OpenSCAP installation",
"requires_ssh: Tests requiring SSH connectivity",
]
filterwarnings = [
"ignore::UserWarning",
"ignore::DeprecationWarning",
"ignore::sqlalchemy.exc.MovedIn20Warning",
]
[tool.coverage.run]
source = ["app"]
omit = [
"*/tests/*",
"*/validation/scenarios/*",
"*/migrations/*",
"*/venv/*",
"*/node_modules/*",
"*/__pycache__/*",
"*/alembic/*",
"*/site-packages/*",
# SSH-dependent modules (require live SSH connections to target hosts)
"app/services/system_info/collector.py",
"app/services/discovery/network.py",
"app/services/discovery/host.py",
"app/services/discovery/security.py",
"app/services/discovery/compliance.py",
"app/services/monitoring/host.py",
"app/services/ssh/connection_manager.py",
"app/services/engine/executors/*",
# Celery task bodies (execute in worker process, not test process)
"app/tasks/scan_tasks.py",
"app/tasks/compliance_tasks.py",
"app/tasks/remediation_tasks.py",
"app/tasks/os_discovery_tasks.py",
"app/tasks/compliance_scheduler_tasks.py",
"app/tasks/adaptive_monitoring_dispatcher.py",
"app/tasks/webhook_tasks.py",
"app/tasks/background_tasks.py",
"app/tasks/monitoring_tasks.py",
"app/tasks/kensa_scan_tasks.py",
# Modules depending on deleted plugin packages
"app/services/plugins/lifecycle/*",
"app/services/rules/cache.py",
"app/services/rules/scanner.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
[tool.black]
line-length = 120
target-version = ['py39', 'py310', 'py311']
include = '\.pyi?$'
extend-exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| migrations
| node_modules
)/
'''
[tool.isort]
profile = "black"
line_length = 120
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
[tool.mypy]
python_version = "3.11"
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
ignore_missing_imports = true
no_implicit_optional = true
no_implicit_reexport = true
strict_equality = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true