-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
112 lines (106 loc) · 5.83 KB
/
pyproject.toml
File metadata and controls
112 lines (106 loc) · 5.83 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
[project]
name = "hadith-rest-api"
version = "0.1.0"
description = "Multilingual REST API for most popular hadith editions : Sahih Al-Bukhari, Sahih Muslim, Jami At-Tirmidhi, Sunan Abu Dawud, Muwatta Malik, and much more."
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"fastapi[standard]>=0.135.1",
"pymongo>=4.16.0",
"slowapi>=0.1.9",
]
[tool.ruff.lint]
extend-select = [
"E", # Pycodestyle errors (style issues)
"W", # Pycodestyle warnings (style issues)
"C90", # McCabe – complexity metric for functions
"I", # isort – import ordering checks
"N", # PEP8 Naming – naming conventions
"D", # Pydocstyle – docstring formatting
"UP", # Pyupgrade – upgrades syntax to newer Python versions
"YTT", # Flake8-2020 – checks for Python 2020 best practices
# "ANN", # Flake8-annotations – enforces type annotation style
"ASYNC",# Flake8-async – checks async/await usage
"S", # Flake8-bandit – security issues
"BLE", # Flake8-blind-except – flags bare excepts
"FBT", # Flake8-boolean-trap – potential pitfalls with booleans
"B", # Flake8-bugbear – common bug patterns
"A", # Flake8-builtins – misuse of Python built-in names
# "COM", # Flake8-commas – trailing/comma issues
# "CPY", # Flake8-copyright – copyright header checks
"C4", # Flake8-comprehensions – best practices in comprehensions
"DTZ", # Flake8-datetimez – requires timezone-aware datetime objects
"T10", # Flake8-debugger – debugger statements (e.g. pdb)
"DJ", # Flake8-django – Django-specific conventions
"EM", # Flake8-errmsg – error message style
"EXE", # Flake8-executable – executable file checks
"FA", # Flake8-future-annotations – future import for annotations
"ISC", # Flake8-implicit-str-concat – warns on implicit string concatenation
"ICN", # Flake8-import-conventions – enforces conventional import aliases
"LOG", # Flake8-logging – proper logging usage
"G", # Flake8-logging-format – logging format string issues
"INP", # Flake8-no-pep420 – warns against non-PEP420 namespace usage
"PIE", # Flake8-pie – Python improvement suggestions
"T20", # Flake8-print – disallows print statements
"PYI", # Flake8-pyi – checks for type stub (.pyi) consistency
"PT", # Flake8-pytest-style – pytest best practices
"Q", # Flake8-quotes – enforces quote style consistency
"RSE", # Flake8-raise – proper raise statement usage
"RET", # Flake8-return – return statement issues
"SLF", # Flake8-self – flags instance methods that don't use self
"SLOT", # Flake8-slots – suggests use of __slots__ where appropriate
"SIM", # Flake8-simplify – code simplification hints
"TID", # Flake8-tidy-imports – enforces specific import styles (e.g., no relative imports)
"TC", # Flake8-type-checking – proper import of typing in type checks
"INT", # Flake8-gettext – checks for proper internationalization usage
"ARG", # Flake8-unused-arguments – flags unused function arguments
"PTH", # Flake8-use-pathlib – encourages pathlib over os.path
"TD", # Flake8-todos – flags TODO comments
"FIX", # Flake8-fixme – flags FIXME comments
# "ERA", # Eradicate – detects commented-out code (potentially dangerous)
"PD", # Pandas-vet – checks pandas-specific code practices
"PGH", # Pygrep-hooks – custom grep hooks for linting
"PL", # Pylint – integration with Pylint conventions
"TRY", # Tryceratops – try/except usage suggestions
"FLY", # Flynt – f-string conversion suggestions
"NPY", # NumPy-specific rules – ensures NumPy coding standards
"FAST", # FastAPI – FastAPI-specific linting rules
"AIR", # Airflow – Airflow-specific linting rules
"PERF", # Perflint – performance-related checks
"FURB", # Refurb – rules for code refurbishment
# "DOC", # Pydoclint – docstring linting and consistency
"RUF", # Ruff-specific rules – additional Ruff checks
]
ignore = [
"E501", # Pycodestyle - line too long
"D1", # Pydocstyle - missing docstring in public module, class, or function
"FBT003", # Flake8-boolean-trap - boolean position value in function call
"D203", # Pydocstyle - one blank line required before class docstring
"D212", # Pydocstyle - summary line should be immediately after the opening quotes.
"D401", # Pydocstyle - Checks for docstring first lines that are not in an imperative mood.
"S311", # Flake8-bandit - Standard pseudo-random generators are not suitable for security/cryptographic purposes
"PERF401", # Perflint - Checks for for loops that can be replaced by a list comprehension.
"RET504", # Flake8-return - Checks for variable assignments that immediately precede a return of the assigned variable.
"FA102", # Flake8-future-annotations - Missing `from __future__ import annotations`, but uses PEP 604 union
"TRY003", # Tryceratops - Checks for long exception messages that are not defined in the exception class itself.
"EM101", # Flake8-errmsg - Checks for the use of string literals in exception constructors.
]
[tool.ruff.lint.extend-per-file-ignores]
"tests/**/*.py" = [
# at least this three should be fine in tests:
"S101", # asserts allowed in tests...
"ARG", # Unused function args -> fixtures nevertheless are functionally relevant...
"FBT", # Don't care about booleans as positional arguments in tests, e.g. via @pytest.mark.parametrize()
# The below are debateable
"PLR2004", # Magic value used in comparison, ...
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
]
[tool.ty.environment]
python = ".venv/"
[dependency-groups]
dev = [
"pytest>=9.0.2",
"pytest-cov>=7.0.0",
"ruff>=0.15.6",
"ty>=0.0.23",
]