Skip to content

Commit

Permalink
bazelize mypy / cmk-ssc
Browse files Browse the repository at this point in the history
Change-Id: I05ddb87ccd181c86211ce45a65325d0ee97e9887
  • Loading branch information
Synss committed Nov 28, 2024
1 parent 3d26fd7 commit a5b3841
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 33 deletions.
33 changes: 2 additions & 31 deletions packages/cmk-server-side-calls/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,8 @@ line-length = 100
[tool.ruff.lint.isort]
order-by-type = false


[tool.mypy]
enable_error_code = [
"explicit-override",
"ignore-without-code",
"mutable-override",
"possibly-undefined",
"redundant-expr",
"redundant-self",
"truthy-bool",
"truthy-iterable",
"unimported-reveal",
"unused-awaitable",
"unused-ignore",
]
explicit_package_bases = true
packages = ["cmk", "tests"]
strict = true
# Miscellaneous stuff not in --strict
disallow_any_decorated = false
disallow_any_explicit = false
disallow_any_expr = true
disallow_any_generics = true
disallow_any_unimported = true
disallow_subclassing_any = true
no_implicit_optional = true
strict_optional = true
warn_unreachable = true
# hidden flags for PEP 688 compat, see https://github.com/python/mypy/issues/15313
disable_bytearray_promotion = true
disable_memoryview_promotion = true
# [tool.mypy]
# mypy config moved to overrides in the root pyproject.toml

[tool.pylint.format]
max-line-length = 100
Expand Down
3 changes: 1 addition & 2 deletions packages/cmk-server-side-calls/run
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ run_check_format() {
}

run_mypy() {
setup_venv
mypy
"${BAZEL_CMD}" build --config=mypy //packages/cmk-ccc:all
}

run_pylint() {
Expand Down
27 changes: 27 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,33 @@ no_implicit_optional = true
strict_optional = true
warn_unreachable = true

[[tool.mypy.overrides]]
module = ["cmk.server_side_calls.*"]
enable_error_code = [
"explicit-override",
"ignore-without-code",
"mutable-override",
"possibly-undefined",
"redundant-expr",
"redundant-self",
"truthy-bool",
"truthy-iterable",
"unimported-reveal",
"unused-awaitable",
"unused-ignore",
]
strict = true
# Miscellaneous stuff not in --strict
disallow_any_decorated = false
disallow_any_explicit = false
disallow_any_expr = true
disallow_any_generics = true
disallow_any_unimported = true
disallow_subclassing_any = true
no_implicit_optional = true
strict_optional = true
warn_unreachable = true

[[tool.mypy.overrides]]
module = ["cmk.gui.form_specs.*"]
disallow_any_generics = true
Expand Down

0 comments on commit a5b3841

Please sign in to comment.