-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruff.toml
More file actions
150 lines (137 loc) · 6.11 KB
/
Copy pathruff.toml
File metadata and controls
150 lines (137 loc) · 6.11 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
142
143
144
145
146
147
148
149
150
# Ruff configuration for METPO
# See: https://docs.astral.sh/ruff/configuration/
# Exclude directories
exclude = [
".git",
".venv",
"__pycache__",
"build",
"dist",
".eggs",
"*.egg-info",
"src/ontology", # ODK-generated ontology files
"notebooks", # Jupyter notebooks
"docs", # Documentation including notebooks and experimental scripts
"large", # Reference data scripts
"downloads",
"local",
]
# Python version target
target-version = "py311"
# Line length
line-length = 100
[lint]
# Enable rules
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
"EXE", # flake8-executable
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"PIE", # flake8-pie
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
"SIM", # flake8-simplify
"PTH", # flake8-use-pathlib
"PL", # pylint
"RUF", # ruff-specific rules
]
# Ignore specific rules
ignore = [
"E501", # line-too-long (handled by formatter)
"PLR0913", # too-many-arguments
"PLR2004", # magic-value-comparison
"PT009", # pytest-unittest-assertion (we use assert)
"RET504", # unnecessary-assign (sometimes clearer)
]
# Allow autofix for all enabled rules
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[format]
# Use double quotes for strings
quote-style = "double"
# Indent with spaces
indent-style = "space"
# Like Black, respect magic trailing commas
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending
line-ending = "auto"
[lint.per-file-ignores]
# Ignore import errors in __init__.py
"__init__.py" = ["F401"]
# Allow print statements in scripts
"metpo/tools/*.py" = ["T201"]
"metpo/scripts/*.py" = ["T201"]
"literature_mining/scripts/*.py" = ["T201"]
# Complexity warnings for specific analysis/utility scripts - refactoring would require significant restructuring
"metpo/bactotraits/bactotraits_metpo_set_difference.py" = ["PLR0915", "PLR0912"]
"metpo/bactotraits/create_bactotraits_file_versions.py" = ["PLR0915"]
"metpo/analysis/assess_ontology_by_api_search.py" = ["PLR0915"]
"metpo/analysis/extract_definitions_from_mappings.py" = ["PLR0915"]
"metpo/analysis/analyze_ontology_value.py" = ["PLR0915", "PLR0912"]
# Ignore complexity checks in analysis scripts
"metpo/analysis/*.py" = ["PLR0912", "PLR0915"]
"literature_mining/analyze_*.py" = ["PLR0912", "PLR0915"]
# Ignore complexity and minor issues in bactotraits data processing scripts
"metpo/bactotraits/*.py" = ["PLR0911", "PLR0912", "PLR0915", "SIM102", "B007", "RUF001", "N806", "EXE002"]
# Database scripts - complexity and minor issues
"metpo/database/audit_chromadb.py" = ["PLR0912", "PLR0915"]
"metpo/database/combine_chromadb.py" = ["PLC0415", "PTH110"]
"metpo/database/filter_ols_chromadb.py" = ["PLR0912", "PLR0915"]
"metpo/database/migrate_to_chromadb_resilient.py" = ["PLR0912", "PLR0915", "SIM115"]
# Literature mining analysis - complexity and style issues
"metpo/literature_mining/analysis/analyze_coverage_by_source_type.py" = ["PLR0915"]
"metpo/literature_mining/analysis/analyze_extractions.py" = ["PLR0912"]
"metpo/literature_mining/analysis/analyze_metpo_database_alignment.py" = ["PLR0915"]
"metpo/literature_mining/analysis/analyze_metpo_efficiency.py" = ["PLR0912", "PLR0915", "SIM102"]
"metpo/literature_mining/analysis/analyze_metpo_grounding.py" = ["PLR0912", "PLR0915", "SIM102"]
"metpo/literature_mining/analysis/analyze_metpo_grounding_filtered.py" = ["PLR0912", "PLR0915"]
"metpo/literature_mining/analysis/compare_extractions.py" = ["PLR0915"]
"metpo/literature_mining/analysis/metpo_assessor.py" = ["B007", "PLR0912", "PLR0915"]
"metpo/literature_mining/analysis/validate_extractions.py" = ["SIM102"]
"metpo/literature_mining/analysis/visualize_ner.py" = ["PLC0415", "PLR0911", "PLR0912"]
# Literature mining scripts
"metpo/literature_mining/scripts/count_extraction_results.py" = ["PLC0415"]
"metpo/literature_mining/scripts/dedupe_and_filter_abstracts.py" = ["PLR0912"]
"metpo/literature_mining/scripts/dedupe_by_content.py" = ["B007", "PLR0912"]
"metpo/literature_mining/scripts/fetch_abstracts_from_dois.py" = ["PLC0415"]
# Pipeline scripts - complexity and minor issues
"metpo/pipeline/analyze_coherence_results.py" = ["PLR0915"]
"metpo/pipeline/analyze_sibling_coherence.py" = ["PLR0912", "PLR0915", "PTH110", "RUF012", "SIM108"]
"metpo/pipeline/categorize_ontologies.py" = ["PLC0206", "PLR0912", "PLR0915"]
"metpo/pipeline/chromadb_semantic_mapper.py" = ["PLC0415", "PLR0912", "PLR0915", "RUF001"]
"metpo/pipeline/embed_ontology_to_chromadb.py" = ["PTH119"]
"metpo/pipeline/fetch_ontology_names.py" = ["SIM113"]
# Presentation scripts
"metpo/presentations/analyze_kg_microbe_metpo.py" = ["PLR0915"]
"metpo/presentations/analyze_ontology_landscape.py" = ["PLR0915"]
"metpo/presentations/calculate_minimum_import_set.py" = ["B007", "PLR0912", "PLR0915"]
# General scripts - complexity warnings
"metpo/scripts/bootstrap_definition_enrichment.py" = ["PLR0912", "PLR0915"]
"metpo/scripts/compare_definitions_with_hierarchy.py" = ["PLR0912", "PLR0915"]
"metpo/scripts/definition_work/fetch_source_metadata.py" = ["PLR0912", "PLR0915"]
"metpo/scripts/definition_work/merge_sparql_with_metadata.py" = ["SIM117"]
"metpo/scripts/find_best_definitions.py" = ["PLR0912", "PLR0915"]
"metpo/scripts/find_best_definitions_comprehensive.py" = ["PLR0912", "PLR0915"]
"metpo/scripts/iterative_definition_improvement.py" = ["PLR0912", "PLR0915", "SIM102"]
"metpo/scripts/plot_embedding_similarity.py" = ["PLR0915"]
"metpo/scripts/propose_definitions_with_llm.py" = ["PLR0915"]
"metpo/scripts/qc_metpo_sheets.py" = ["PLR0915", "RUF001"]
# Tools
"metpo/tools/import_bactotraits.py" = ["PLR0912", "PLR0915"]
[lint.isort]
known-first-party = ["metpo"]
force-single-line = false
force-sort-within-sections = false