forked from fmz/SpotObserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruff.toml
More file actions
124 lines (109 loc) · 5.12 KB
/
Copy pathruff.toml
File metadata and controls
124 lines (109 loc) · 5.12 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
# =============================================================================
# Ruff Configuration
# =============================================================================
# Ruff is an extremely fast Python linter and formatter, written in Rust.
# Docs: https://docs.astral.sh/ruff/configuration/
#
# =============================================================================
target-version = "py39"
line-length = 100
# =============================================================================
# EXCLUSIONS
# =============================================================================
# Directories/files to exclude from linting and formatting.
#
# Standard exclusions:
# __pycache__ - Python bytecode cache
# .git - Git internals
# .venv - Virtual environment
# experiments - Experiment outputs (logs, checkpoints, etc.)
#
# Project-specific:
# src/archive - Archived/deprecated code (kept for reference)
#
# =============================================================================
exclude = [
"__pycache__",
".git",
".venv",
"experiments",
"src/archive",
]
# =============================================================================
# LINT RULES
# =============================================================================
# Rule selection philosophy: Start strict, add ignores as needed.
# Better to have CI catch potential issues than miss them.
#
# Rule categories enabled:
# STARTER (safe defaults):
# F - Pyflakes: undefined names, unused imports, shadowing
# E/W - pycodestyle: PEP8 style violations (errors/warnings)
# I - isort: import sorting and grouping
#
# RECOMMENDED (quality):
# B - flake8-bugbear: common bugs, anti-patterns, footguns
# UP - pyupgrade: automatic Python version upgrades
# SIM - flake8-simplify: simplifiable constructs
# RUF - Ruff-specific: Ruff's own high-quality rules
#
# RESEARCH/ML (domain-specific):
# NPY - NumPy: NumPy-specific rules (deprecated APIs, etc.)
# PD - pandas-vet: pandas-specific rules (chained assignment, etc.)
# ANN - flake8-annotations: type annotation issues
# Note: This project uses typeguard, so should have good coverage.
# If too noisy, add specific ANN codes to per-file-ignores.
#
# =============================================================================
[lint]
select = [
# --- Starter (safe defaults) ---
"F", # Pyflakes: undefined names, unused imports
"E", "W", # pycodestyle: PEP8 errors (E) and warnings (W)
"I", # isort: import sorting
# --- Recommended (quality) ---
"B", # flake8-bugbear: common bugs and anti-patterns
"UP", # pyupgrade: use modern Python syntax
"SIM", # flake8-simplify: simplifiable constructs
"RUF", # Ruff-specific: high-quality Ruff rules
# --- Research/ML (domain-specific) ---
"NPY", # NumPy-specific rules
"PD", # pandas-vet
"ANN", # flake8-annotations: type hints
]
ignore = [
"E501", # Line too long: Formatter handles this; remaining cases are acceptable
"W292", # No newline at end of file: Formatter handles this automatically
"RUF001", # Ambiguous Unicode: Greek letters (σ, α) and math symbols (×) are intentional in scientific code
]
# =============================================================================
# PER-FILE IGNORES
# =============================================================================
# Add specific rule ignores for files that have legitimate reasons.
# Format: "path/pattern" = ["CODE1", "CODE2"]
# =============================================================================
[lint.per-file-ignores]
# Add file-specific ignores here as needed
# =============================================================================
# ISORT CONFIGURATION
# =============================================================================
# isort handles import sorting and grouping.
# known-first-party: Packages that are part of this project (not third-party).
# =============================================================================
# =============================================================================
# FLAKE8-ANNOTATIONS CONFIGURATION
# =============================================================================
# allow-star-arg-any: Suppress ANN401 for *args/**kwargs with Any type.
# Rationale: Pass-through kwargs (e.g., to matplotlib) are impractical to type
# precisely. Using Any is standard practice for wrapper functions.
# =============================================================================
[lint.flake8-annotations]
allow-star-arg-any = true
# =============================================================================
# FORMAT CONFIGURATION
# =============================================================================
# Ruff format is a drop-in replacement for Black.
# docstring-code-format: Format code examples in docstrings.
# =============================================================================
[format]
docstring-code-format = true