-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
103 lines (95 loc) · 4.36 KB
/
pyproject.toml
File metadata and controls
103 lines (95 loc) · 4.36 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
# Original ruff configuration (strict)
[tool.ruff]
# Exclude common directories
exclude = [
".git",
".venv",
"venv",
"__pycache__",
"build",
"dist",
]
line-length = 100
target-version = "py39"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"D", # pydocstyle
"UP", # pyupgrade
"N", # pep8-naming
"C", # flake8-comprehensions
"B", # flake8-bugbear
"A", # flake8-builtins
"S", # flake8-bandit
"T", # flake8-debugger
"Q", # flake8-quotes
"ANN", # flake8-annotations
]
ignore = [
# Documentation - these are often self-explanatory
"D102", # Missing docstring in public method
"D107", # Missing docstring in __init__
"D105", # Missing docstring in magic method
"D104", # Missing docstring in public package
"D106", # Missing docstring in public nested class
# Type annotations - sometimes Any is necessary
"ANN401", # Dynamically typed expressions (Any) are disallowed
# Naming conventions - often from external libraries or mathematical conventions
"N806", # Variable in function should be lowercase (e.g., DataFrame)
"N803", # Argument name should be lowercase
# Security - these need case-by-case review
"S105", # Possible hardcoded password (often false positives)
"S106", # Possible hardcoded password in function arg
"S301", # Pickle usage (needed for ML models)
"S311", # Standard pseudo-random generators (ok for non-crypto)
# Other reasonable exceptions
"B008", # Do not perform function calls in argument defaults (FastAPI uses this pattern)
]
# Only allow E402 in specific files
[tool.ruff.lint.per-file-ignores]
"src/cli/signatures.py" = ["E402"]
"tests/*" = ["D", "ANN", "S101", "S105", "S108", "N806", "N803"] # Don't require docstrings/types in tests, allow assert
"cli/tests/*" = ["D", "ANN", "S101", "S105", "S108", "N806", "N803"] # Same for CLI tests
"hokusai-ml-platform/tests/*" = ["D", "ANN", "S101", "S105", "S108", "S603", "N806", "N803"] # Same for platform tests
# Allow try-except-pass only in specific files where it's used for optional features
"src/integrations/mlflow_dspy.py" = ["S110"] # Optional signature extraction
"src/services/dspy/validators.py" = ["S110"] # Optional validation
"src/services/inference_pipeline.py" = ["S110"] # Optional confidence calculation
"src/utils/zk_output_formatter.py" = ["S110"] # Optional formatting
"tests/integration/test_baseline_loader_integration.py" = ["S110"] # Test cleanup
"src/api/models/schema_models.py" = ["ANN", "N805", "N803"]
"src/api/models/audit_log.py" = ["A003"]
"src/api/models/consent_record.py" = ["A003"]
"src/api/models/dataset_license.py" = ["A003"]
"src/api/models/inference_log.py" = ["A003"]
"src/api/models/retention_policy.py" = ["A003"]
"src/api/models/evaluation_schedule.py" = ["A003"]
"src/api/schemas/evaluation_schedule.py" = ["A003", "ANN102"]
"src/api/schemas/inference_log.py" = ["ANN", "N805", "N803"]
"src/api/routes/governance.py" = ["E501"]
"src/api/services/governance/audit_logger.py" = ["ANN", "A003", "D401", "E501"]
"src/api/services/governance/gdpr.py" = ["ANN"]
"src/api/services/governance/licensing.py" = ["ANN", "E501"]
"src/api/services/governance/retention.py" = ["ANN", "E501"]
"src/api/services/contributor_logger.py" = ["ANN"]
"src/api/services/privacy/pii_detector.py" = ["ANN"]
"src/api/services/evaluation_service.py" = ["ANN", "E501"]
"src/api/endpoints/model_serving.py" = ["ANN", "D401", "D417", "UP006", "UP035", "B904", "F841", "T201"]
"migrations/versions/*.py" = ["D103", "D400", "D415"]
# Pre-existing annotation/type-hint issues; all existed before HOK-1362
"src/events/publishers/webhook_publisher.py" = [
"ANN101", "ANN201", "ANN202", "ANN204", "ANN003",
"UP006", "UP035",
"E501", "E722",
"B904", "D401",
]
"tests/unit/test_webhook_publisher.py" = ["E402"]
# Inner-class override methods and lazy-import helper lack annotations; pre-existing before HOK-1362
"hokusai-ml-platform/src/hokusai/cli.py" = ["ANN101", "ANN001", "ANN202"]
# Pre-existing annotation/docstring issues; all existed before HOK-1470
"src/events/schemas.py" = ["ANN101", "ANN102", "ANN201", "ANN204", "ANN001", "D401"]
"src/services/model_registry_hooks.py" = ["ANN101", "ANN204", "D401"]
"src/services/enhanced_model_registry.py" = ["ANN101", "ANN204", "ANN002", "ANN003"]