-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
64 lines (52 loc) 路 1.85 KB
/
Copy pathpyproject.toml
File metadata and controls
64 lines (52 loc) 路 1.85 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
# This file is used to configure project settings and tools for the Rewards Eligibility Oracle project.
# It defines configurations for linting, formatting, and other development tools to maintain code quality
# and consistency across the project. Specifically, it sets up rules for Ruff, a fast Python linter and
# formatter, to enforce coding standards, manage import sorting, and handle code complexity.
[tool.ruff]
# Allow line lengths up to 115 characters.
line-length = 115
target-version = "py39"
# Enable auto-fixing for most issues, but not line length
fix = true
fix-only = false
[tool.ruff.format]
# Format SQL code in strings/docstrings
docstring-code-format = false
quote-style = "double"
indent-style = "space"
line-ending = "lf"
[tool.ruff.lint]
# Enable rules including isort (I) for import sorting and additional fixes
select = ["E", "W", "F", "I"]
# Exclude a variety of commonly ignored directories.
exclude = [
".git",
".ruff_cache",
"venv",
"__pycache__",
]
# Prevent auto-fixing line length issues
unfixable = ["E501"]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Specify rules to ignore in specific files
[tool.ruff.lint.per-file-ignores]
# Ignore E402 (import not at top) in scripts and specific modules
"scripts/test_*.py" = ["E402"]
"src/models/rewards_eligibility_oracle.py" = ["E402"]
# Use unsafe fixes to address typing and other modernization issues
[tool.ruff.lint.isort]
known-first-party = ["src"]
[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.mypy]
ignore_missing_imports = true
no_strict_optional = true
explicit_package_bases = true
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--cov=src --cov-report=term-missing -v"
testpaths = ["tests"]
python_files = "test_*.py"
pythonpath = ["."]