@@ -180,6 +180,7 @@ error-on-warning = true
180180fixable = [" ALL" ]
181181ignore = [
182182 " COM812" ,
183+ " PERF203" , # try-except in loop — all existing hits are intentional (retry loops, error skipping)
183184 " PLR0913" , # Too many arguments, MCP Servers have a lot of arguments, OKAY?!
184185 " SIM102" , # Dont require combining if statements
185186]
@@ -194,12 +195,14 @@ extend-select = [
194195 " INP" , # flake8-no-pep420: Require __init__.py in namespace packages
195196 " ISC" , # flake8-implicit-str-concat: Prevent accidental string concatenation
196197 " LOG" , # flake8-logging: Catches logging module misuse
198+ " PERF" , # perflint: Performance anti-patterns (unnecessary copies, allocations)
197199 " PIE" , # flake8-pie: More idiomatic Python code
198200 " PLE" , # pylint-error: Catches actual errors (invalid operations, syntax issues)
199201 " RSE" , # flake8-raise: Unnecessary parentheses on raise
200202 " RUF" , # Ruff-specific: Modern best practices unique to Ruff
201203 " SIM" , # flake8-simplify: Simplifies verbose code patterns
202204 " SLOT" , # flake8-slots: Enforce __slots__ where applicable
205+ " T20" , # flake8-print: Catch accidental print() in library code
203206 " TID" , # flake8-tidy-imports: Banned imports and relative import enforcement
204207 " UP" , # pyupgrade: Modernize syntax for newer Python versions
205208]
@@ -211,6 +214,10 @@ known-first-party = ["fastmcp"]
211214"__init__.py" = [" F401" , " I001" , " RUF013" ]
212215# allow imports not at the top of the file
213216"src/fastmcp/__init__.py" = [" E402" ]
217+ # CLI and example code legitimately uses print() for user-facing output
218+ "src/fastmcp/cli/**.py" = [" T20" ]
219+ "src/fastmcp/client/oauth_callback.py" = [" T20" ]
220+ "src/fastmcp/contrib/**/example.py" = [" T20" ]
214221"!src/**.py" = [ # Only enforce extended ruff rules for code in src/
215222 " B" , # flake8-bugbear
216223 " C4" , # flake8-comprehensions
@@ -221,12 +228,14 @@ known-first-party = ["fastmcp"]
221228 " INP" , # flake8-no-pep420
222229 " ISC" , # flake8-implicit-str-concat
223230 " LOG" , # flake8-logging
231+ " PERF" , # perflint
224232 " PIE" , # flake8-pie
225233 " PLE" , # pylint-error
226234 " RSE" , # flake8-raise
227235 " RUF" , # Ruff-specific
228236 " SIM" , # flake8-simplify
229237 " SLOT" , # flake8-slots
238+ " T20" , # flake8-print
230239 " TID" , # flake8-tidy-imports
231240]
232241
0 commit comments