mypy ¤
Callable for Mypy.
Functions:
-
run
–Run mypy.
run ¤
run(
*paths: str,
config_file: str | None = None,
enable_incomplete_feature: bool | None = None,
verbose: bool | None = None,
warn_unused_configs: bool | None = None,
no_namespace_packages: bool | None = None,
ignore_missing_imports: bool | None = None,
follow_imports: (
Literal["normal", "silent", "skip", "error"] | None
) = None,
python_executable: str | None = None,
no_site_packages: bool | None = None,
no_silence_site_packages: bool | None = None,
python_version: str | None = None,
py2: bool | None = None,
platform: str | None = None,
always_true: list[str] | None = None,
always_false: list[str] | None = None,
disallow_any_unimported: bool | None = None,
disallow_any_expr: bool | None = None,
disallow_any_decorated: bool | None = None,
disallow_any_explicit: bool | None = None,
disallow_any_generics: bool | None = None,
disallow_subclassing_any: bool | None = None,
disallow_untyped_calls: bool | None = None,
disallow_untyped_defs: bool | None = None,
disallow_incomplete_defs: bool | None = None,
check_untyped_defs: bool | None = None,
disallow_untyped_decorators: bool | None = None,
implicit_optional: bool | None = None,
no_strict_optional: bool | None = None,
warn_redundant_casts: bool | None = None,
warn_unused_ignores: bool | None = None,
no_warn_no_return: bool | None = None,
warn_return_any: bool | None = None,
warn_unreachable: bool | None = None,
allow_untyped_globals: bool | None = None,
allow_redefinition: bool | None = None,
no_implicit_reexport: bool | None = None,
strict_equality: bool | None = None,
strict_concatenate: bool | None = None,
strict: bool | None = None,
disable_error_code: str | None = None,
enable_error_code: str | None = None,
show_error_context: bool | None = None,
show_column_numbers: bool | None = None,
show_error_end: bool | None = None,
hide_error_codes: bool | None = None,
pretty: bool | None = None,
no_color_output: bool | None = None,
no_error_summary: bool | None = None,
show_absolute_path: bool | None = None,
no_incremental: bool | None = None,
cache_dir: str | None = None,
sqlite_cache: bool | None = None,
cache_fine_grained: bool | None = None,
skip_version_check: bool | None = None,
skip_cache_mtime_checks: bool | None = None,
pdb: bool | None = None,
show_traceback: bool | None = None,
raise_exceptions: bool | None = None,
custom_typing_module: str | None = None,
disable_recursive_aliases: bool | None = None,
custom_typeshed_dir: str | None = None,
warn_incomplete_stub: bool | None = None,
shadow_file: tuple[str, str] | None = None,
any_exprs_report: str | None = None,
cobertura_xml_report: str | None = None,
html_report: str | None = None,
linecount_report: str | None = None,
linecoverage_report: str | None = None,
lineprecision_report: str | None = None,
txt_report: str | None = None,
xml_report: str | None = None,
xslt_html_report: str | None = None,
xslt_txt_report: str | None = None,
junit_xml: str | None = None,
find_occurrences: str | None = None,
scripts_are_modules: bool | None = None,
install_types: bool | None = None,
non_interactive: bool | None = None,
explicit_package_bases: bool | None = None,
exclude: str | None = None,
module: str | None = None,
package: str | None = None,
command: str | None = None
) -> None
Run mypy.
Parameters:
-
*paths
(str
, default:()
) –Path to scan.
-
config_file
(str | None
, default:None
) –Configuration file, must have a [mypy] section (defaults to mypy.ini, .mypy.ini,
-
enable_incomplete_feature
(bool | None
, default:None
) –Enable support of incomplete/experimental features for early preview.
-
verbose
(bool | None
, default:None
) –More verbose messages. pyproject.toml, setup.cfg, /home/pawamoy/.config/mypy/config, ~/.config/mypy/config, ~/.mypy.ini).
-
warn_unused_configs
(bool | None
, default:None
) –Warn about unused '[mypy-
]' or '[[tool.mypy.overrides]]' config sections (inverse: --no-warn-unused-configs). -
no_namespace_packages
(bool | None
, default:None
) –Support namespace packages (PEP 420, init.py-less) (inverse: --namespace-packages).
-
ignore_missing_imports
(bool | None
, default:None
) –Silently ignore imports of missing modules.
-
follow_imports
(Literal['normal', 'silent', 'skip', 'error'] | None
, default:None
) –How to treat imports (default normal).
-
python_executable
(str | None
, default:None
) –Python executable used for finding PEP 561 compliant installed packages and stubs.
-
no_site_packages
(bool | None
, default:None
) –Do not search for installed PEP 561 compliant packages.
-
no_silence_site_packages
(bool | None
, default:None
) –Do not silence errors in PEP 561 compliant installed packages.
-
python_version
(str | None
, default:None
) –Type check code assuming it will be running on Python x.y.
-
py2
(bool | None
, default:None
) –Use Python 2 mode (same as --python-version 2.7).
-
platform
(str | None
, default:None
) –Type check special-cased code for the given OS platform (defaults to sys.platform).
-
always_true
(list[str] | None
, default:None
) –Additional variable to be considered True (may be repeated).
-
always_false
(list[str] | None
, default:None
) –Additional variable to be considered False (may be repeated).
-
disallow_any_unimported
(bool | None
, default:None
) –Disallow Any types resulting from unfollowed imports.
-
disallow_any_expr
(bool | None
, default:None
) –Disallow all expressions that have type Any.
-
disallow_any_decorated
(bool | None
, default:None
) –Disallow functions that have Any in their signature after decorator transformation.
-
disallow_any_explicit
(bool | None
, default:None
) –Disallow explicit Any in type positions.
-
disallow_any_generics
(bool | None
, default:None
) –Disallow usage of generic types that do not specify explicit type parameters (inverse: --allow-any-generics).
-
disallow_subclassing_any
(bool | None
, default:None
) –Disallow subclassing values of type 'Any' when defining classes (inverse: --allow-subclassing-any).
-
disallow_untyped_calls
(bool | None
, default:None
) –Disallow calling functions without type annotations from functions with type annotations (inverse: --allow-untyped-calls).
-
disallow_untyped_defs
(bool | None
, default:None
) –Disallow defining functions without type annotations or with incomplete type annotations (inverse: --allow-untyped-defs).
-
disallow_incomplete_defs
(bool | None
, default:None
) –Disallow defining functions with incomplete type annotations (inverse: --allow-incomplete-defs).
-
check_untyped_defs
(bool | None
, default:None
) –Type check the interior of functions without type annotations (inverse: --no-check-untyped-defs).
-
disallow_untyped_decorators
(bool | None
, default:None
) –Disallow decorating typed functions with untyped decorators (inverse: --allow-untyped-decorators).
-
implicit_optional
(bool | None
, default:None
) –Assume arguments with default values of None are Optional(inverse: --no-implicit-optional).
-
no_strict_optional
(bool | None
, default:None
) –Disable strict Optional checks (inverse: --strict-optional).
-
warn_redundant_casts
(bool | None
, default:None
) –Warn about casting an expression to its inferred type (inverse: --no-warn-redundant-casts).
-
warn_unused_ignores
(bool | None
, default:None
) –Warn about unneeded '# type: ignore' comments (inverse: --no-warn-unused-ignores).
-
no_warn_no_return
(bool | None
, default:None
) –Do not warn about functions that end without returning (inverse: --warn-no-return).
-
warn_return_any
(bool | None
, default:None
) –Warn about returning values of type Any from non-Any typed functions (inverse: --no-warn-return-any).
-
warn_unreachable
(bool | None
, default:None
) –Warn about statements or expressions inferred to be unreachable (inverse: --no-warn-unreachable).
-
allow_untyped_globals
(bool | None
, default:None
) –Suppress toplevel errors caused by missing annotations (inverse: --disallow-untyped-globals).
-
allow_redefinition
(bool | None
, default:None
) –Allow unconditional variable redefinition with a new type (inverse: --disallow-redefinition).
-
no_implicit_reexport
(bool | None
, default:None
) –Treat imports as private unless aliased (inverse: --implicit-reexport).
-
strict_equality
(bool | None
, default:None
) –Prohibit equality, identity, and container checks for non-overlapping types (inverse: --no-strict-equality).
-
strict_concatenate
(bool | None
, default:None
) –Make arguments prepended via Concatenate be truly positional-only (inverse: --no-strict-concatenate).
-
strict
(bool | None
, default:None
) –Strict mode; enables the following flags: --warn-unused-configs, --disallow-any-generics, --disallow-subclassing-any, --disallow-untyped-calls, --disallow-untyped-defs, --disallow-incomplete-defs, --check-untyped-defs, --disallow-untyped-decorators, --warn-redundant-casts, --warn-unused-ignores, --warn-return-any, --no-implicit-reexport, --strict-equality, --strict-concatenate.
-
disable_error_code
(str | None
, default:None
) –Disable a specific error code.
-
enable_error_code
(str | None
, default:None
) –Enable a specific error code.
-
show_error_context
(bool | None
, default:None
) –Precede errors with "note:" messages explaining context (inverse: --hide-error-context).
-
show_column_numbers
(bool | None
, default:None
) –Show column numbers in error messages (inverse: --hide-column-numbers).
-
show_error_end
(bool | None
, default:None
) –Show end line/end column numbers in error messages. This implies --show-column-numbers (inverse: --hide-error-end).
-
hide_error_codes
(bool | None
, default:None
) –Hide error codes in error messages (inverse: --show-error-codes).
-
pretty
(bool | None
, default:None
) –Use visually nicer output in error messages: Use soft word wrap, show source code snippets, and show error location markers (inverse: --no-pretty).
-
no_color_output
(bool | None
, default:None
) –Do not colorize error messages (inverse: --color-output).
-
no_error_summary
(bool | None
, default:None
) –Do not show error stats summary (inverse: --error-summary).
-
show_absolute_path
(bool | None
, default:None
) –Show absolute paths to files (inverse: --hide-absolute-path).
-
no_incremental
(bool | None
, default:None
) –Disable module cache (inverse: --incremental).
-
cache_dir
(str | None
, default:None
) –Store module cache info in the given folder in incremental mode (defaults to '.mypy_cache').
-
sqlite_cache
(bool | None
, default:None
) –Use a sqlite database to store the cache (inverse: --no-sqlite-cache).
-
cache_fine_grained
(bool | None
, default:None
) –Include fine-grained dependency information in the cache for the mypy daemon.
-
skip_version_check
(bool | None
, default:None
) –Allow using cache written by older mypy version.
-
skip_cache_mtime_checks
(bool | None
, default:None
) –Skip cache internal consistency checks based on mtime.
-
pdb
(bool | None
, default:None
) –Invoke pdb on fatal error.
-
show_traceback
(bool | None
, default:None
) –Show traceback on fatal error.
-
raise_exceptions
(bool | None
, default:None
) –Raise exception on fatal error.
-
custom_typing_module
(str | None
, default:None
) –Use a custom typing module.
-
disable_recursive_aliases
(bool | None
, default:None
) –Disable experimental support for recursive type aliases.
-
custom_typeshed_dir
(str | None
, default:None
) –Use the custom typeshed in DIR.
-
warn_incomplete_stub
(bool | None
, default:None
) –Warn if missing type annotation in typeshed, only relevant with --disallow-untyped-defs or --disallow-incomplete-defs enabled (inverse: --no-warn-incomplete-stub).
-
shadow_file
(tuple[str, str] | None
, default:None
) –When encountering SOURCE_FILE, read and type check the contents of SHADOW_FILE instead..
-
any_exprs_report
(str | None
, default:None
) –Report any expression.
-
cobertura_xml_report
(str | None
, default:None
) –Report Cobertura.
-
html_report
(str | None
, default:None
) –Report HTML.
-
linecount_report
(str | None
, default:None
) –Report line count.
-
linecoverage_report
(str | None
, default:None
) –Report line coverage.
-
lineprecision_report
(str | None
, default:None
) –Report line precision.
-
txt_report
(str | None
, default:None
) –Report text.
-
xml_report
(str | None
, default:None
) –Report XML.
-
xslt_html_report
(str | None
, default:None
) –Report XLST HTML.
-
xslt_txt_report
(str | None
, default:None
) –Report XLST text.
-
junit_xml
(str | None
, default:None
) –Write junit.xml to the given file.
-
find_occurrences
(str | None
, default:None
) –Print out all usages of a class member (experimental).
-
scripts_are_modules
(bool | None
, default:None
) –Script x becomes module x instead of main.
-
install_types
(bool | None
, default:None
) –Install detected missing library stub packages using pip (inverse: --no-install-types).
-
non_interactive
(bool | None
, default:None
) –Install stubs without asking for confirmation and hide errors, with --install-types (inverse: --interactive).
-
explicit_package_bases
(bool | None
, default:None
) –Use current directory and MYPYPATH to determine module names of files passed (inverse: --no-explicit-package-bases).
-
exclude
(str | None
, default:None
) –Regular expression to match file names, directory names or paths which mypy should ignore while recursively discovering files to check, e.g. --exclude '/setup.py$'. May be specified more than once, eg. --exclude a --exclude b.
-
module
(str | None
, default:None
) –Type-check module; can repeat for more modules.
-
package
(str | None
, default:None
) –Type-check package recursively; can be repeated.
-
command
(str | None
, default:None
) –Type-check program passed in as string.
Source code in src/duty/callables/mypy.py
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 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 |
|