| # Copyright 2023 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| [tool.black] |
| # Following the Google Python style guide, we set the maximum line length |
| # to 80 characters. See: https://google.github.io/styleguide/pyguide.html#32-line-length |
| line-length = 80 |
| target-version = ['py311'] |
| include = '\.pyi?$' |
| exclude = ''' |
| # Start regex with a forward slash so that black will only ignore these files |
| # if they're in the root of the repo. |
| ^/( |
| ( |
| \.jiri_root |
| | out |
| | third_party |
| | prebuilt |
| | __pycache__ |
| ) |
| ) |
| ''' |
| |
| [tool.mypy] |
| strict = true |
| pretty = true |
| |
| # We need to ignore missing imports since some of our source code dependencies |
| # reside in the 'third_party' directory, which may not always be in python path. |
| ignore_missing_imports = true |
| |
| # TODO(b/324270220): Temporarily disable this flag to ease the transition to |
| # type checking. Re enable this flag for stricter checking in the future. |
| warn_return_any = false |
| |
| # 'yaml' module imports aren't working with the global |
| # 'ignore_missing_imports' flag. Overriding using overridesr entry. |
| [[tool.mypy.overrides]] |
| module = "yaml" |
| ignore_missing_imports = true |
| |
| # The below overrides are for Honeydew modules. |
| [[tool.mypy.overrides]] |
| # TODO(b/326472322): Investigate Honeydew module import failure with full path |
| module = "tests.functional_tests.*" |
| # To handle `error: Class cannot subclass "FuchsiaBaseTest" (has type "Any") [misc]` |
| # More info @ https://github.com/python/mypy/issues/9318 |
| disallow_subclassing_any = false |
| |
| [[tool.mypy.overrides]] |
| # TODO(b/326472322): Investigate Honeydew module import failure with full path |
| module = "tests.unit_tests.*" |
| # TODO(b/322232685) - unit tests are not mypy compatible with `strict=true`. |
| # Unable to override `strict` config in per-module config. More info @ https://github.com/python/mypy/issues/11401. |
| # As a result, disable specific config options for unit tests that were enabled |
| # by `strict=true` until unit test code addresses these warnings. |
| allow_untyped_defs = true |
| allow_untyped_decorators = true |
| allow_incomplete_defs = true |
| disable_error_code = ["attr-defined"] |